{ "info": { "author": "Jon Aquino", "author_email": "jonathan.aquino@adroll.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "==========\npython-hll\n==========\n\n\n.. image:: https://img.shields.io/pypi/v/python_hll.svg\n :target: https://pypi.python.org/pypi/python_hll\n\n.. image:: https://readthedocs.org/projects/python-hll/badge/?version=latest\n :target: https://python-hll.readthedocs.io/en/latest/?badge=latest\n :alt: Documentation Status\n\n.. image:: https://img.shields.io/badge/github-python--hll-yellow\n :target: https://github.com/AdRoll/python-hll\n\nA Python implementation of `HyperLogLog `_\nwhose goal is to be `storage compatible `_\nwith `java-hll `_, `js-hll `_\nand `postgresql-hll `_.\n\n**NOTE:** This is a fairly literal translation/port of `java-hll `_\nto Python. Internally, bytes are represented as Java-style bytes (-128 to 127) rather than Python-style bytes (0 to 255).\nAlso this implementation is quite slow: for example, in Java ``HLLSerializationTest`` takes 12 seconds to run\nwhile in Python ``test_hll_serialization`` takes 1.5 hours to run (about 400x slower).\n\n* Runs on: Python 2.7 and 3\n* Free software: MIT license\n* Documentation: https://python-hll.readthedocs.io.\n\nOverview\n---------------\nSee `java-hll `_ for an overview of what HLLs are and how they work.\n\nUsage\n---------------\n\nHashing and adding a value to a new HLL::\n\n from python_hll.hll import HLL\n import mmh3\n value_to_hash = 'foo'\n hashed_value = mmh3.hash(value_to_hash)\n\n hll = HLL(13, 5) # log2m=13, regwidth=5\n hll.add_raw(hashed_value)\n\nRetrieving the cardinality of an HLL::\n\n cardinality = hll.cardinality()\n\nUnioning two HLLs together (and retrieving the resulting cardinality)::\n\n hll1 = HLL(13, 5) # log2m=13, regwidth=5\n hll2 = HLL(13, 5) # log2m=13, regwidth=5\n\n # ... (add values to both sets) ...\n\n hll1.union(hll2) # modifies hll1 to contain the union\n cardinalityUnion = hll1.cardinality()\n\nReading an HLL from a hex representation of\n`storage specification, v1.0.0 `_\n(for example, retrieved from a `PostgreSQL database `_)::\n\n from python_hll.util import NumberUtil\n input = '\\\\x128D7FFFFFFFFFF6A5C420'\n hex_string = input[2:]\n hll = HLL.from_bytes(NumberUtil.from_hex(hex_string, 0, len(hex_string)))\n\nWriting an HLL to its hex representation of\n`storage specification, v1.0.0 `_\n(for example, to be inserted into a `PostgreSQL database `_)::\n\n bytes = hll.to_bytes()\n output = \"\\\\x\" + NumberUtil.to_hex(bytes, 0, len(bytes))\n\nDevelopment\n---------------\nSee the `Contributing` document for how to get started building and testing the code.\n\n=======\nHistory\n=======\n\n0.0.0 (2019-06-14)\n------------------\n\n* Submitted to AdRoll HackWeek.\n\n0.1.0 (2019-09-12)\n------------------\n\n* First release on PyPI.\n\n0.1.1 (2019-09-12)\n------------------\n\n* Add missing install_requires: numpy\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/AdRoll/python-hll", "keywords": "python_hll", "license": "MIT license", "maintainer": "", "maintainer_email": "", "name": "python-hll", "package_url": "https://pypi.org/project/python-hll/", "platform": "", "project_url": "https://pypi.org/project/python-hll/", "project_urls": { "Homepage": "https://github.com/AdRoll/python-hll" }, "release_url": "https://pypi.org/project/python-hll/0.1.1/", "requires_dist": [ "numpy" ], "requires_python": "", "summary": "Python library for the HyperLogLog algorithm", "version": "0.1.1" }, "last_serial": 5824000, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "3ece7ccea18be19de36c205ef33de90c", "sha256": "12247836519ccc5b58cb155df582aeb3e6209e0bb97ed530f0c2f377d163d900" }, "downloads": -1, "filename": "python_hll-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "3ece7ccea18be19de36c205ef33de90c", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 26136, "upload_time": "2019-09-12T23:59:27", "url": "https://files.pythonhosted.org/packages/49/74/707071fcfc7c6b09e15d01327def2796921005d8c1266372ac479ebcd056/python_hll-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2e5276896ba1f7e40b43b894b816ab8d", "sha256": "2811055e22b47b78b73ef23917b023009f0d18e24c32e9d9adeaec0f3adc1770" }, "downloads": -1, "filename": "python_hll-0.1.0.tar.gz", "has_sig": false, "md5_digest": "2e5276896ba1f7e40b43b894b816ab8d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2076632, "upload_time": "2019-09-12T23:59:35", "url": "https://files.pythonhosted.org/packages/f0/39/94c8bf81926e053b3ca3aec0290059a3c22b226e440009393c775668be38/python_hll-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "e041ed003c9e2dde2eabb1920b369e2f", "sha256": "bc9fde7648ab40acd3b84d76938b190204ead2857f0598c971274fa4860fa6bb" }, "downloads": -1, "filename": "python_hll-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e041ed003c9e2dde2eabb1920b369e2f", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 26601, "upload_time": "2019-09-13T05:49:04", "url": "https://files.pythonhosted.org/packages/79/8e/7b6915619a21757ba020f96653435d6c9a186724b131406f3ea43a811c0b/python_hll-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "31a1bec79427eeb955855ce77b4a4132", "sha256": "c0768cdc15fa17e0018ce65abf674e15d4c60921e42d8940bd2896884ad25fd9" }, "downloads": -1, "filename": "python_hll-0.1.1.tar.gz", "has_sig": false, "md5_digest": "31a1bec79427eeb955855ce77b4a4132", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2083759, "upload_time": "2019-09-13T05:49:10", "url": "https://files.pythonhosted.org/packages/05/1d/de9e7aec45a6ea0f1ffe0ebba976d32d4ad25097ef48bc71f565b904b5a8/python_hll-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e041ed003c9e2dde2eabb1920b369e2f", "sha256": "bc9fde7648ab40acd3b84d76938b190204ead2857f0598c971274fa4860fa6bb" }, "downloads": -1, "filename": "python_hll-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e041ed003c9e2dde2eabb1920b369e2f", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 26601, "upload_time": "2019-09-13T05:49:04", "url": "https://files.pythonhosted.org/packages/79/8e/7b6915619a21757ba020f96653435d6c9a186724b131406f3ea43a811c0b/python_hll-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "31a1bec79427eeb955855ce77b4a4132", "sha256": "c0768cdc15fa17e0018ce65abf674e15d4c60921e42d8940bd2896884ad25fd9" }, "downloads": -1, "filename": "python_hll-0.1.1.tar.gz", "has_sig": false, "md5_digest": "31a1bec79427eeb955855ce77b4a4132", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2083759, "upload_time": "2019-09-13T05:49:10", "url": "https://files.pythonhosted.org/packages/05/1d/de9e7aec45a6ea0f1ffe0ebba976d32d4ad25097ef48bc71f565b904b5a8/python_hll-0.1.1.tar.gz" } ] }