{ "info": { "author": "Steve Stagg, Lars Fenneberg", "author_email": "stestagg@gmail.com, lf@elemental.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3" ], "description": "sparsebitfield\n==============\n\nThis is a fork of https://github.com/stestagg/bitfield which has been\nadapted to be efficient with sparse bitfields and large numbers. The\nAPI is the same but support for Python 2 has been dropped.\n\n__WARNING__ : The serialisation mechanism isn't portable at the moment.\n\nInstallation\n------------\n\n```\n$ sudo pip3 install sparsebitfield\n```\n\nUsage\n-----\n\n```python\n>>> import sparsebitfield\n>>> field = sparsebitfield.SparseBitfield()\n>>> field.add(100)\n>>> print(list(field))\n[100]\n>>> second = sparsebitfield.SparseBitfield([2, 100])\n>>> list(field | second)\n[2, 100]\n\n>>> second.add(10000)\n>>> second.pickle()\nb'BZ:x\\x9c\\xed\\xce\\xc1\\t\\x00 \\x0c\\x04\\xb0+8@\\xf7\\x9f\\xd6\\x87\\x0f7P(\\xc9\\x04I\\x8eZ\\xb9:\\x00\\x93\\xd4\\xef\\x00\\x00\\x00\\x00\\x00\\x00\\x00<\\xb3\\x01\\xda\\x86\\x00\\x17'\n\n>>> import random\n>>> large=sparsebitfield.SparseBitfield(random.sample(range(1000000), 500000)) # 500,000 items, randomly distributed\n>>> len(large)\n500000\n>>> len(large.pickle())\n125269 # 122KB\n\n>>> large=sparsebitfield.SparseBitfield(range(1000000)) # 1 million items, all sequential\n>>> len(large)\n1000000\n>>> len(large.pickle())\n69 # <100 bytes\n```\n\nSparse bitfields support most of the same operations/usage as regular sets,\nsee the tests for examples.\n\nDesign\n------\n\nSparsebitfield was designed to efficiently handle tracking large sets of items.\n\nThe main design goals were:\n * Space-efficient serialisation format\n * Fast membership tests and set differences\n * Space-efficent handling of large sparse bitfields\n * Support for large integers (>2**64)\n\nInternally, sparsebitfield achieves this by using a 1-d bitmap split into\npages. These pages are organised as a sorted list.\n\nWithin a page, a number is recorded as being present in the set by setting\nthe n-th bit to 1. I.e. the set([1]) is recorded as ...00000010b, while\nset([1,4]) would be ...00010010b.\n\nIf a particular page is empty (no set members in that range) or full, then\nthe bitfield is discarded, and represented by an EMPTY or FULL flag. Pages\nwhich haven not been written to don't take up any memory at all. Also empty\npages are not included in the pickled data.", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/elemental-lf/sparsebitfield", "keywords": "", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "sparsebitfield", "package_url": "https://pypi.org/project/sparsebitfield/", "platform": "", "project_url": "https://pypi.org/project/sparsebitfield/", "project_urls": { "Homepage": "http://github.com/elemental-lf/sparsebitfield" }, "release_url": "https://pypi.org/project/sparsebitfield/0.2.2/", "requires_dist": null, "requires_python": "", "summary": "A Cython fast number set based on bitfields", "version": "0.2.2" }, "last_serial": 4108467, "releases": { "0.2.1": [ { "comment_text": "", "digests": { "md5": "13eb91cc4d6a3ba6545159ac4fb8605e", "sha256": "f523b40e1d87b4cd554e7e192d7f868b060c7bd08aa3beec9ff9eb71d9729572" }, "downloads": -1, "filename": "sparsebitfield-0.2.1.tar.gz", "has_sig": false, "md5_digest": "13eb91cc4d6a3ba6545159ac4fb8605e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 94007, "upload_time": "2018-07-27T12:08:35", "url": "https://files.pythonhosted.org/packages/2e/21/22192dd4cb0dd9dbb1dc20c10ec72179f21bc01d17e6a336e0167dfb5abf/sparsebitfield-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "87878aa2760426b4eb93bf3fa209cb49", "sha256": "f684624c2b6f86301cc7050020e7b16e53af93d8f80bc0e6961aa0950b0803c0" }, "downloads": -1, "filename": "sparsebitfield-0.2.2.tar.gz", "has_sig": false, "md5_digest": "87878aa2760426b4eb93bf3fa209cb49", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 95040, "upload_time": "2018-07-27T12:14:17", "url": "https://files.pythonhosted.org/packages/05/31/129f9822e40e42a95b4b2cdca7bc82ba039f1c6300ce5bddaa6f454cd919/sparsebitfield-0.2.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "87878aa2760426b4eb93bf3fa209cb49", "sha256": "f684624c2b6f86301cc7050020e7b16e53af93d8f80bc0e6961aa0950b0803c0" }, "downloads": -1, "filename": "sparsebitfield-0.2.2.tar.gz", "has_sig": false, "md5_digest": "87878aa2760426b4eb93bf3fa209cb49", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 95040, "upload_time": "2018-07-27T12:14:17", "url": "https://files.pythonhosted.org/packages/05/31/129f9822e40e42a95b4b2cdca7bc82ba039f1c6300ce5bddaa6f454cd919/sparsebitfield-0.2.2.tar.gz" } ] }