{ "info": { "author": "dzdx", "author_email": "dzidaxie@gmail.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.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5" ], "description": "===============================\npyintset\n===============================\n\n\n.. image:: https://img.shields.io/pypi/v/pyintset.svg\n :target: https://pypi.python.org/pypi/pyintset\n\n.. image:: https://img.shields.io/travis/dzdx/pyintset.svg\n :target: https://travis-ci.org/dzdx/pyintset\n :alt: Updates\n\n\npyintset is a set for storing integers.\npyintset can store any length of integer numbers, support Python int and long type.\n\nit's intersection, union and difference the operation faster than the python standard library set, but the add and remove operations slower than the set.\n\n\n* Free software: MIT license\n\n\n\nusage\n-----\n\ninit\n^^^^^\npyintset can init by set, list, dict and any other iterable collection, include it self.\n::\n \n >>>from intset import IntSet\n >>> IntSet(range(10))\n IntSet([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])\n >>> IntSet(range(1<<100,(1<<100)+5))\n IntSet([1267650600228229401496703205376L, 1267650600228229401496703205377L, 1267650600228229401496703205378L, 1267650600228229401496703205379L, 1267650600228229401496703205380L])\n >>> IntSet(xrange(10))\n IntSet([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])\n >>> IntSet(set(range(10,20)))\n IntSet([10, 11, 12, 13, 14, 15, 16, 17, 18, 19])\n >>> IntSet(IntSet(range(10,20)))\n IntSet([10, 11, 12, 13, 14, 15, 16, 17, 18, 19])\n \nmethod\n^^^^^^^^\npyintset supports most methods of set. In addition, because it is stored in order, it is also supported get_item and get_slice, max, min\n::\n\n >>> IntSet(range(0,20))&IntSet(range(15,25))\n IntSet([15, 16, 17, 18, 19])\n >>> IntSet(range(0,20)).intersection(IntSet(range(15,25)))\n IntSet([15, 16, 17, 18, 19])\n >>> s = IntSet(range(0, 20))\n >>> s.intersection_update(IntSet(range(5,25)))\n >>> s\n IntSet([5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19])\n >>> s.intersection_update(range(6, 25))\n >>> s\n IntSet([6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19])\n >>> s = IntSet(range(10))\n >>> s.update(range(1<<64, (1<<64)+5))\n >>> s\n IntSet([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 18446744073709551616L, 18446744073709551617L, 18446744073709551618L, 18446744073709551619L, 18446744073709551620L])\n >>> IntSet(range(200, 300))[10:30]\n IntSet([210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229])\n >>> IntSet(range(200, 300))[25]\n 225\n \n\nbenchmark\n--------------\nTest machine:\n^^^^^^^^^^^^^^\nLinux 3.2.0-23-generic x86_64 #36-Ubuntu SMP Tue Apr 10 20:39:51 UTC 2012\n\nPython Versions:\n^^^^^^^^^^^^^^^^\nCPython 2.7.12 (default, Jul 18 2016, 14:59:49) [GCC 4.6.3]\n\n======================================== ======================================== ========================================\nbenchmark IntSet set\n======================================== ======================================== ========================================\nbenchmark_add 0.0082049369812 0.00174403190613\nbenchmark_difference 0.0508291721344 1.43595719337\nbenchmark_discard 0.00447106361389 0.00148987770081\nbenchmark_intersection 0.0479021072388 2.73467516899\nbenchmark_issubset 0.00648403167725 0.0442490577698\nbenchmark_issuperset 0.00768518447876 0.0346069335938\nbenchmark_symmetric_difference 0.0477960109711 2.45564603806\nbenchmark_union 0.0476861000061 2.07998609543\nbenchmark_update 0.622309923172 0.059406042099\n======================================== ======================================== ========================================\n\n\nmemory profile\n---------------\n\n::\n\n Filename: memory_profile.py\n\n Line # Mem usage Increment Line Contents\n ================================================\n 13 35.633 MiB 0.000 MiB @profile\n 14 def create_intsets():\n 15 43.516 MiB 7.883 MiB data = [IntSet(items) for _ in range(1000)]\n\n\n Filename: memory_profile.py\n\n Line # Mem usage Increment Line Contents\n ================================================\n 16 43.516 MiB 0.000 MiB @profile\n 17 def create_long_intsets():\n 18 44.805 MiB 1.289 MiB data = [IntSet(long_items) for _ in range(1000)]\n\n\n Filename: memory_profile.py\n\n Line # Mem usage Increment Line Contents\n ================================================\n 20 33.465 MiB 0.000 MiB @profile\n 21 def create_sets():\n 22 158.652 MiB 125.188 MiB data = [set(items) for _ in range(1000)]\n\n\n Filename: memory_profile.py\n\n Line # Mem usage Increment Line Contents\n ================================================\n 24 35.652 MiB 0.000 MiB @profile\n 25 def create_long_sets():\n 26 158.652 MiB 123.000 MiB data = [set(long_items) for _ in range(1000)]\n\n\n\napi\n------\n\n============================================== =========\nmethod example doc\n============================================== =========\ns.add( (|) ) Add an Integer to a intset. return None.\ns.remove( (|) ) Remove an Integer from a intset. If the Integer is not a member, raise a KeyError.\ns.discard( (|) ) Remove an Integer from a intset.\\n If the Integer is not a member, do noting.\ns.max() Get the max Integer in a intset.\\n If the intset is empty, raise a ValueError.\ns.min() Get the min Integer in a intset.\\n If the intset is empty, raise a ValueError.\ns.clear() Remove all elements from this intset.\ns.copy() Return a copy of a intset.\ns.issubset() Report whether another intset contains this intset.\ns.issuperset() Report whether this intset contains another intset.\ns.intersection() Return the intersection of an intset and an iterable object as a new intset.\ns.intersection_update() Update a intset with the intersection of itself and other iterable object.\ns.union() Return the union of an intset and an iterable object as a new intset.\ns.update() Update a intset with the union of itself and other iterable object.\ns.difference() Return the difference of an intset and an iterable object as a new intset.\ns.difference_update(iterable>) Update a intset with the difference of itself and other iterable object.\ns.symmetric_difference() Return the symmetric_difference of an intset and an iterable object as a new intset.\ns.symmetric_difference_update() Update a intset with the symmetric_difference of itself and other iterable object.\ns& \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Similar to intersection, but only accept an intset\ns| \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Similar to union, but only accept an intset \ns^ \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Similar to symmetric_difference, but only accept an intset\ns- \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Similar to difference, but only accept an intset\n(||>=`) <= is similar to issubset, >= is similar to issuperset\n============================================== =========\n\n\nCredits\n---------\n\nThis package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.\n\n.. _Cookiecutter: https://github.com/audreyr/cookiecutter\n.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage\n\n\n=======\nHistory\n=======\n\n0.1.0 (2017-04-14)\n------------------\n\n* First release on PyPI.\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/dzdx/pyintset", "keywords": "intset", "license": "MIT license", "maintainer": "", "maintainer_email": "", "name": "pyintset", "package_url": "https://pypi.org/project/pyintset/", "platform": "any", "project_url": "https://pypi.org/project/pyintset/", "project_urls": { "Homepage": "https://github.com/dzdx/pyintset" }, "release_url": "https://pypi.org/project/pyintset/0.1.5/", "requires_dist": null, "requires_python": "", "summary": "", "version": "0.1.5" }, "last_serial": 5455382, "releases": { "0.1.2": [ { "comment_text": "", "digests": { "md5": "329d7b00a66dc058ec472c0bd7376072", "sha256": "3f5e292412385b2638a9029511a008d1260228735a1dadff40caa44b1bb5754a" }, "downloads": -1, "filename": "pyintset-0.1.2-cp27-cp27m-macosx_10_12_x86_64.whl", "has_sig": false, "md5_digest": "329d7b00a66dc058ec472c0bd7376072", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 26274, "upload_time": "2017-04-15T05:58:41", "url": "https://files.pythonhosted.org/packages/e4/19/6b4f41425d8be6c8a70ac33070619d006d620faee15e4e91faded8aaffbb/pyintset-0.1.2-cp27-cp27m-macosx_10_12_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "ce44c247ead5b8fb7435ba4fe91dd7db", "sha256": "a5ee6fdcd757b7bba225af82867bd2213910e67a5d90438951f7033a56a587c6" }, "downloads": -1, "filename": "pyintset-0.1.2.tar.gz", "has_sig": false, "md5_digest": "ce44c247ead5b8fb7435ba4fe91dd7db", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19186, "upload_time": "2017-04-15T05:57:55", "url": "https://files.pythonhosted.org/packages/e9/ea/c252824535196d97261f9faf5d03f7587efd0a618c855d148a5ced4615f7/pyintset-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "1078784e4585ae7b830725e71126dc69", "sha256": "dd4b37a2106489956062ba54882c520798df68455139d4cb1b2601b2808c0011" }, "downloads": -1, "filename": "pyintset-0.1.3.tar.gz", "has_sig": false, "md5_digest": "1078784e4585ae7b830725e71126dc69", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22166, "upload_time": "2017-04-15T06:14:46", "url": "https://files.pythonhosted.org/packages/61/ce/5d4c51a0e582356fe00d25971a271d59b36cf910fd38fab8baca966d8d7b/pyintset-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "1e9eba8888577f3096b50ffd36a1cf13", "sha256": "043e5841ac7bb68ed8909cc04aed6ca0615bc83f91bda675cc64fad04f0b1917" }, "downloads": -1, "filename": "pyintset-0.1.4.tar.gz", "has_sig": false, "md5_digest": "1e9eba8888577f3096b50ffd36a1cf13", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23743, "upload_time": "2018-09-24T09:03:06", "url": "https://files.pythonhosted.org/packages/43/a7/d884f9d5aebf4a410944b6c841e1d3660e0271d18a17281a14711cd9f31f/pyintset-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "2d3f190d993ccd9b4a1abbef2bcdf146", "sha256": "b0719e1588d159943ccbd003f6673cbd41d83799d2ed076201572fbda025c732" }, "downloads": -1, "filename": "pyintset-0.1.5-cp27-cp27m-macosx_10_14_intel.whl", "has_sig": false, "md5_digest": "2d3f190d993ccd9b4a1abbef2bcdf146", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 19540, "upload_time": "2019-06-27T06:53:34", "url": "https://files.pythonhosted.org/packages/56/b5/7e79358eb2251797493de118c179fe01e2f1d13f5f0352318e4a2e29c1e8/pyintset-0.1.5-cp27-cp27m-macosx_10_14_intel.whl" }, { "comment_text": "", "digests": { "md5": "46e45151a00024d4b20977b799dabe79", "sha256": "a333ecd2ea5fae3f815afc7e7c21bb3f9392b38820a9adf11d656dcceb32aaa8" }, "downloads": -1, "filename": "pyintset-0.1.5.tar.gz", "has_sig": false, "md5_digest": "46e45151a00024d4b20977b799dabe79", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20480, "upload_time": "2019-06-27T06:53:26", "url": "https://files.pythonhosted.org/packages/66/e7/b299c0d9163e4c4b803ec4082f5b8aaa6d704e8bde1e8c0f2de5cbd70ac3/pyintset-0.1.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2d3f190d993ccd9b4a1abbef2bcdf146", "sha256": "b0719e1588d159943ccbd003f6673cbd41d83799d2ed076201572fbda025c732" }, "downloads": -1, "filename": "pyintset-0.1.5-cp27-cp27m-macosx_10_14_intel.whl", "has_sig": false, "md5_digest": "2d3f190d993ccd9b4a1abbef2bcdf146", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 19540, "upload_time": "2019-06-27T06:53:34", "url": "https://files.pythonhosted.org/packages/56/b5/7e79358eb2251797493de118c179fe01e2f1d13f5f0352318e4a2e29c1e8/pyintset-0.1.5-cp27-cp27m-macosx_10_14_intel.whl" }, { "comment_text": "", "digests": { "md5": "46e45151a00024d4b20977b799dabe79", "sha256": "a333ecd2ea5fae3f815afc7e7c21bb3f9392b38820a9adf11d656dcceb32aaa8" }, "downloads": -1, "filename": "pyintset-0.1.5.tar.gz", "has_sig": false, "md5_digest": "46e45151a00024d4b20977b799dabe79", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20480, "upload_time": "2019-06-27T06:53:26", "url": "https://files.pythonhosted.org/packages/66/e7/b299c0d9163e4c4b803ec4082f5b8aaa6d704e8bde1e8c0f2de5cbd70ac3/pyintset-0.1.5.tar.gz" } ] }