{ "info": { "author": "Michal Nazarewicz", "author_email": "mina86@mina86.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "pygtrie\n=======\n\n.. image:: https://readthedocs.org/projects/pygtrie/badge/?version=latest\n :target: http://pygtrie.readthedocs.io/en/latest/\n :alt: Documentation build status (latest)\n\n.. image:: https://readthedocs.org/projects/pygtrie/badge/?version=stable\n :target: http://pygtrie.readthedocs.io/en/stable/\n :alt: Documentation build status (stable)\n\n.. image:: https://api.travis-ci.com/mina86/pygtrie.svg\n :target: https://travis-ci.com/mina86/pygtrie\n :alt: Continuous integration status\n\npygtrie is a Python library implementing a trie data structure.\n\n`Trie data structure `_, also known\nas radix or prefix tree, is a tree associating keys to values where\nall the descendants of a node have a common prefix (associated with\nthat node).\n\nThe trie module contains ``Trie``, ``CharTrie`` and ``StringTrie``\nclasses each implementing a mutable mapping interface, i.e. ``dict``\ninterface. As such, in most circumstances, ``Trie`` could be used as\na drop-in replacement for a ``dict``, but the prefix nature of the\ndata structure is trie\u2019s real strength.\n\nThe module also contains ``PrefixSet`` class which uses a trie to\nstore a set of prefixes such that a key is contained in the set if it\nor its prefix is stored in the set.\n\nFeatures\n--------\n\n- A full mutable mapping implementation.\n\n- Supports iterating over as well as deleting a subtrie.\n\n- Supports prefix checking as well as shortest and longest prefix\n look-up.\n\n- Extensible for any kind of user-defined keys.\n\n- A PrefixSet supports \u201call keys starting with given prefix\u201d logic.\n\n- Can store any value including None.\n\nInstallation\n------------\n\nTo install pygtrie, run::\n\n pip install pygtrie\n\nOr download the sources and save ``pygtrie.py`` file with your\nproject.\n\nUpgrading from 0.9.x\n--------------------\n\nThe 1.0 release introduced backwards incompatibility in naming. The\nmodule has been renamed from ``trie`` to ``pygtrie``. Fortunately,\nupdating scripts using pygtrie should boil down to replacing::\n\n from pytrie import trie\n\nwith::\n\n import pygtrie as trie\n\nVersion History\n---------------\n\n2.3.2: 2019/07/18\n\n- Trivial metadata fix\n\n2.3.1: 2019/07/18 [pulled back from PyPi]\n\n- Fix to ``pygtrie.PrefixSet`` initialisation incorrectly storing\n elements even if their prefixes are also added to the set.\n\n For example, ``PrefixSet(('foo', 'foobar'))`` incorrectly resulted\n in a two-element set even though the interface dictates that only\n ``foo`` is kept (recall that if ``foo`` is member of the set,\n ``foobar`` is as well). [Thanks to Tal Maimon for reporting]\n\n- Fix to ``pygtrie.Trie.copy`` method not preserving\n enable-sorting flag and, in case of ``pygtrie.StringTrie``,\n ``separator`` property. Related to this, add support for the\n ``copy`` module so ``copy.copy`` can now be used with the\n objects.\n\n- Leafs and nodes with just one child use more mummery-optimised\n representation which reduces overall memory usage of a trie\n structure.\n\n- Minor performance improvement for adding new elements to\n a ``pygtrie.PrefixSet``.\n\n- Improvements to string representation of objects which now include\n type and, for ``pygtrie.StringTrie`` object, value of separator\n property.\n\n2.3: 2018/08/10\n\n- New ``walk_towards`` method allows walking a path towards given\n a node with given key accessing each step of the path. Compared to\n prefixes method, steps for nodes without assigned values are\n\n- Fix to ``pygtrie.PrefixSet.copy`` not preserving type of backing\n trie.\n\n- ``pygtrie.StringTrie`` now checks and explicitly rejects empty\n separators. Previously empty separator would be accepted but lead\n to confusing errors later on. [Thanks to Waren Long].\n\n- Various documentation improvements, Python 2/3 compatibility and\n test coverage (python-coverage reports 100%).\n\n2.2: 2017/06/03\n\n- Fixes to ``setup.py`` breaking on Windows which prevents\n installation among other things.\n\n2.1: 2017/03/23\n\n- The library is now Python 3 compatible.\n\n- Value returend by ``pygtrie.Trie.shortest_prefix`` and\n ``pygtrie.Trie.longest_prefix`` evaluates to false if no prefix was\n found. This is in addition to it being a pair of Nones of course.\n\n2.0: 2016/07/06\n\n- Sorting of child nodes is disabled by default for better\n performance. ``pygtrie.Trie.enable_sorting`` method can be used\n to bring back old behaviour.\n\n- Tries of arbitrary depth can be pickled without reaching Python\u2019s\n recursion limits. (N.B. The pickle format is incompatible with one\n from 1.2 release). ``_Node``\u2019s ``__getstate__`` and ``__setstate__``\n method can be used to implement other serialisation methods such as\n JSON.\n\n1.2: 2016/06/21 [pulled back from PyPi]\n\n- Tries can now be pickled.\n\n- Iterating no longer uses recursion so tries of arbitrary depth can\n be iterated over. The ``pygtrie.Trie.traverse`` method,\n however, still uses recursion thus cannot be used on big structures.\n\n1.1: 2016/01/18\n\n- Fixed PyPi installation issues; all should work now.\n\n1.0: 2015/12/16\n\n- The module has been renamed from ``trie`` to ``pygtrie``. This\n could break current users but see documentation for how to quickly\n upgrade your scripts.\n\n- Added ``pygtrie.Trie.traverse`` method which goes through the\n nodes of the trie preserving structure of the tree. This is\n a depth-first traversal which can be used to search for elements or\n translate a trie into a different tree structure.\n\n- Minor documentation fixes.\n\n0.9.3: 2015/05/28\n\n- Minor documentation fixes.\n\n0.9.2: 2015/05/28\n\n- Added Sphinx configuration and updated docstrings to work better\n with Sphinx.\n\n0.9.1: 2014/02/03\n\n- New name.\n\n0.9: 2014/02/03\n\n- Initial release.", "description_content_type": "", "docs_url": null, "download_url": "https://github.com/mina86/pygtrie/tarball/v2.3.2", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/mina86/pygtrie", "keywords": "trie,prefix tree,data structure", "license": "Apache-2.0", "maintainer": "", "maintainer_email": "", "name": "pygtrie", "package_url": "https://pypi.org/project/pygtrie/", "platform": "Platform Independent", "project_url": "https://pypi.org/project/pygtrie/", "project_urls": { "Download": "https://github.com/mina86/pygtrie/tarball/v2.3.2", "Homepage": "https://github.com/mina86/pygtrie" }, "release_url": "https://pypi.org/project/pygtrie/2.3.2/", "requires_dist": null, "requires_python": "", "summary": "Trie data structure implementation.", "version": "2.3.2" }, "last_serial": 5563990, "releases": { "0.9.1": [ { "comment_text": "", "digests": { "md5": "3a6f99b2da13edf51862cdc0d297c0d9", "sha256": "6e50fde0c25a0e46cdf21270e8e6aa4381a92f34a445a690c9995fbc8dc7cc34" }, "downloads": -1, "filename": "pygtrie-0.9.1.tar.gz", "has_sig": false, "md5_digest": "3a6f99b2da13edf51862cdc0d297c0d9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11089, "upload_time": "2014-02-03T18:03:01", "url": "https://files.pythonhosted.org/packages/c7/57/0a772a1d186b2908a6691db0e52e560de993b3cf310a6fd058cd58e019ff/pygtrie-0.9.1.tar.gz" } ], "0.9.2": [ { "comment_text": "", "digests": { "md5": "4fab4fa9a5411426f8ee1fac11e927f6", "sha256": "e66f286af1c2f8749a980f1ddddd6aac33837f3e5bd6712b94bdbaac8b9656e6" }, "downloads": -1, "filename": "pygtrie-0.9.2.tar.gz", "has_sig": false, "md5_digest": "4fab4fa9a5411426f8ee1fac11e927f6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15683, "upload_time": "2015-05-08T20:26:57", "url": "https://files.pythonhosted.org/packages/3e/72/c384a0c885cd82e056c1c7039dbccb84cde7214bd95dffd4bca37da7beb8/pygtrie-0.9.2.tar.gz" } ], "0.9.3": [ { "comment_text": "", "digests": { "md5": "e4eff4a4ec6faf3ba155471163f670f8", "sha256": "9a799ebe5c344d2e88544bd1e7e9d6b98fe43d8d618dcfe329fa30e71f807925" }, "downloads": -1, "filename": "pygtrie-0.9.3.tar.gz", "has_sig": false, "md5_digest": "e4eff4a4ec6faf3ba155471163f670f8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15695, "upload_time": "2015-05-08T21:32:38", "url": "https://files.pythonhosted.org/packages/39/38/b9c3c86a92773fd87aade1d3699669f8db65b6e662daacae7c2bdd8ae6af/pygtrie-0.9.3.tar.gz" } ], "1.0": [ { "comment_text": "", "digests": { "md5": "fa297fa7e1a79a389c79e5b46705819d", "sha256": "8ad6828e5a35ffb2fdef9e4ee249f7eef9a4c3fd8cddd98d69f99813ea78df34" }, "downloads": -1, "filename": "pygtrie-1.0.tar.gz", "has_sig": false, "md5_digest": "fa297fa7e1a79a389c79e5b46705819d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10812, "upload_time": "2015-12-16T22:54:24", "url": "https://files.pythonhosted.org/packages/24/63/85cc31540fcb663e2f2fc5d4da5b1aee7f217ceeccbad3270dc3c245cd8b/pygtrie-1.0.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "a6b9dc3a168952e7abe0ca4952b0810e", "sha256": "dcb3ec1256977fc5467fb46b80b3a54b9e2711947afb31f6c3907acbde7e957f" }, "downloads": -1, "filename": "pygtrie-1.1.tar.gz", "has_sig": false, "md5_digest": "a6b9dc3a168952e7abe0ca4952b0810e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17551, "upload_time": "2016-01-18T15:56:42", "url": "https://files.pythonhosted.org/packages/8f/e0/d98fddba69045e049cb535a735c9dafbbd1812bb2d5bb4f0f4c96b34f99d/pygtrie-1.1.tar.gz" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "64da8dc8f8a32c0e5e8418963ee6be15", "sha256": "c02a32a9b4e2180350ec2e1d6cebe1e7ede681b7c815e47fa9a7aeb8666a2509" }, "downloads": -1, "filename": "pygtrie-1.2.tar.gz", "has_sig": false, "md5_digest": "64da8dc8f8a32c0e5e8418963ee6be15", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18531, "upload_time": "2016-06-21T17:08:42", "url": "https://files.pythonhosted.org/packages/e1/09/9c96b8fa76e523d119a52fb1097674e4cb2d7fdafa34c60d43a4de47a3b0/pygtrie-1.2.tar.gz" } ], "2.0": [ { "comment_text": "", "digests": { "md5": "b4fd25cb4a91acdcff4cd356f8fa68ac", "sha256": "bfe2e757d6fd2cf08c1af05bcea87058683060afe710b5ef3578b1b89b7ef19d" }, "downloads": -1, "filename": "pygtrie-2.0.tar.gz", "has_sig": false, "md5_digest": "b4fd25cb4a91acdcff4cd356f8fa68ac", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20808, "upload_time": "2016-07-06T14:42:02", "url": "https://files.pythonhosted.org/packages/3b/32/bef8a3d1e225d97d2e1a1cc23d7eea2492b54162744202ef3e6466676085/pygtrie-2.0.tar.gz" } ], "2.1": [ { "comment_text": "", "digests": { "md5": "87c58a41d3e4e81a0dfc7eacc1d8c9cb", "sha256": "38c292e7adfcaae5e0808029be7d467165e0dac6937d8245bf21e283c4afaef7" }, "downloads": -1, "filename": "pygtrie-2.1.tar.gz", "has_sig": false, "md5_digest": "87c58a41d3e4e81a0dfc7eacc1d8c9cb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24056, "upload_time": "2017-03-23T16:39:09", "url": "https://files.pythonhosted.org/packages/e4/60/fce0fe3ec60ba0902fa6157260175c8d7ffeee130c65ecbdfc077933f833/pygtrie-2.1.tar.gz" } ], "2.2": [ { "comment_text": "", "digests": { "md5": "5a38448451a0fe473b3f6cad0fe1c59e", "sha256": "01f2a8f41b1c9fd6cc29edae5c908d2cd6cc69d0bf31e3dea6ea31fe97fff9d3" }, "downloads": -1, "filename": "pygtrie-2.2.tar.gz", "has_sig": false, "md5_digest": "5a38448451a0fe473b3f6cad0fe1c59e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24175, "upload_time": "2017-07-03T13:47:18", "url": "https://files.pythonhosted.org/packages/20/17/5dbbd3145de8a8b5755b3b44805b939719c9f5c8e552de7849ada2b47b68/pygtrie-2.2.tar.gz" } ], "2.3": [ { "comment_text": "", "digests": { "md5": "886548e5c799f94beba62473f82e9667", "sha256": "28261896d9fea0439d5ee521403812b444c041036d2335b86dbf9c9c2ec1a703" }, "downloads": -1, "filename": "pygtrie-2.3.tar.gz", "has_sig": false, "md5_digest": "886548e5c799f94beba62473f82e9667", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29613, "upload_time": "2018-08-10T19:41:06", "url": "https://files.pythonhosted.org/packages/9d/42/f70a09ce102fa2fc1c54df26f71ecbf0a38e78c1da0b1b58bcf539cf2e94/pygtrie-2.3.tar.gz" } ], "2.3.2": [ { "comment_text": "", "digests": { "md5": "d98ef5906d8cf686ecd2fd49d3faa7c9", "sha256": "6299cdedd2cbdfda0895c2dbc43efe8828e698c62b574f3ef7e14b3253f80e23" }, "downloads": -1, "filename": "pygtrie-2.3.2.tar.gz", "has_sig": false, "md5_digest": "d98ef5906d8cf686ecd2fd49d3faa7c9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 33242, "upload_time": "2019-07-21T17:46:47", "url": "https://files.pythonhosted.org/packages/18/41/2e5cefc895a32d9ca0f3574bd0df09e53a697023579a93582bedc4eeac4d/pygtrie-2.3.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d98ef5906d8cf686ecd2fd49d3faa7c9", "sha256": "6299cdedd2cbdfda0895c2dbc43efe8828e698c62b574f3ef7e14b3253f80e23" }, "downloads": -1, "filename": "pygtrie-2.3.2.tar.gz", "has_sig": false, "md5_digest": "d98ef5906d8cf686ecd2fd49d3faa7c9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 33242, "upload_time": "2019-07-21T17:46:47", "url": "https://files.pythonhosted.org/packages/18/41/2e5cefc895a32d9ca0f3574bd0df09e53a697023579a93582bedc4eeac4d/pygtrie-2.3.2.tar.gz" } ] }