{ "info": { "author": "Mikhail Korobov", "author_email": "kmike84@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Programming Language :: Cython", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Scientific/Engineering :: Information Analysis", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Text Processing :: Linguistic" ], "description": "hat-trie\n========\n\nHAT-Trie structure for Python (2.x and 3.x).\n\nThis package is a Python wrapper for `hat-trie`_ C library.\n\n.. image:: https://travis-ci.org/kmike/hat-trie.svg?branch=master\n :target: https://travis-ci.org/kmike/hat-trie\n\n.. _hat-trie: https://github.com/dcjones/hat-trie\n\nInstallation\n============\n\n::\n\n pip install hat-trie\n\nUsage\n=====\n\nCreate a new trie::\n\n >>> from hat_trie import Trie\n >>> trie = Trie()\n\n``trie`` variable is a dict-like object that support unicode\nkeys and can have any Python object as a value. For keys that share prefixes\nit usually uses less memory than Python dict.\n\nThere is also ``hat_trie.IntTrie`` which only supports positive\nintegers as values. It can be more efficient when you don't need\narbitrary objects as values. For example, if you need to store float\nvalues then storing them in an array (either numpy or stdlib's ``array.array``)\nand using IntTrie values as indices could be more memory efficient\nthan storing Python float objects directly in ``hat_trie.Trie``.\n\nAnother way to store float values is to use hat_trie.FloatTrie().\nIn this case precision is limited to float32.\n\nCurrently implemented methods are:\n\n* __getitem__()\n* __setitem__()\n* __contains__()\n* __len__()\n* get()\n* setdefault()\n* keys()\n* iterkeys()\n\nOther methods are not implemented - contributions are welcome!\n\n\nPerformance\n===========\n\nPerformance is measured for ``hat_trie.Trie`` against Python's dict with\n100k unique unicode words (English and Russian) as keys and '1' numbers\nas values.\n\nBenchmark results for Python 3.3 (intel i5 1.8GHz,\n\"1.000M ops/sec\" == \"1 000 000 operations per second\")::\n\n dict __getitem__ (hits) 6.874M ops/sec\n trie __getitem__ (hits) 3.754M ops/sec\n dict __contains__ (hits) 7.035M ops/sec\n trie __contains__ (hits) 3.772M ops/sec\n dict __contains__ (misses) 5.356M ops/sec\n trie __contains__ (misses) 3.364M ops/sec\n dict __len__ 785958.286 ops/sec\n trie __len__ 574164.704 ops/sec\n dict __setitem__ (updates) 6.830M ops/sec\n trie __setitem__ (updates) 3.472M ops/sec\n dict __setitem__ (inserts) 6.774M ops/sec\n trie __setitem__ (inserts) 2.460M ops/sec\n dict setdefault (updates) 3.522M ops/sec\n trie setdefault (updates) 2.680M ops/sec\n dict setdefault (inserts) 4.062M ops/sec\n trie setdefault (inserts) 1.866M ops/sec\n dict keys() 189.564 ops/sec\n trie keys() 16.067 ops/sec\n\n\nHAT-Trie is about 1.5x faster that `datrie`_ on all supported operations;\nit also supports fast inserts unlike datrie. On the other hand,\ndatrie has more features (e.g. better iteration support and richer API);\ndatrie is also more memory efficient.\n\nIf you need a memory efficient data structure and don't need inserts\nthen marisa-trie_ or DAWG_ should work better.\n\n.. _datrie: https://github.com/kmike/datrie\n.. _marisa-trie: https://github.com/kmike/marisa-trie\n.. _DAWG: https://github.com/kmike/DAWG\n\nContributing\n============\n\nDevelopment happens at github:\n\n* https://github.com/kmike/hat-trie\n\nFeel free to submit ideas, bugs, pull requests or regular patches.\n\nPlease don't commit changes to generated C files; I will rebuild them myself.\n\nRunning tests and benchmarks\n----------------------------\n\nMake sure `tox`_ is installed and run\n\n::\n\n $ ./update_c.sh\n $ tox\n\nfrom the source checkout. You will need Cython_ to do that.\n\nTests should pass under python 2.7 and 3.3+.\n\n::\n\n $ tox -c bench.ini\n\nruns benchmarks.\n\n.. _Cython: http://cython.org\n.. _tox: http://tox.testrun.org\n\nAuthors & Contributors\n----------------------\n\n* Mikhail Korobov \n* Brandon Forehand \n* https://github.com/yflau\n* Michael Heilman \n* Michael Phan-Ba @mikepb\n\nThis module wraps `hat-trie`_ C library by Daniel Jones & contributors.\n\nLicense\n=======\n\nLicensed under MIT License.\n\n\n0.3 (2016-02-08)\n----------------\n\n* hat-trie C library is updated to the latest version (thanks Michael Phan-Ba);\n* FloatTrie (thanks Michael Phan-Ba);\n* Python 2.6 and Python 3.2 support is dropped. hat-trie 0.3 likely still works\n in 2.6 and 3.2, but this is no longer checked by unit tests, and\n future compatibility is not guaranteed;\n* setup.py is switched to setuptools.\n\n\n0.2 (2014-08-22)\n----------------\n\n* Installation is simplified: Cython is no longer required;\n* ``get`` method for tries (thanks Brandon Forehand);\n* ``iterkeys`` method is fixed (thanks Brandon Forehand);\n* ``hat_trie.Trie`` can store any Python object as a value (thanks Brandon Forehand);\n* segfault is fixed for large int values (thanks Brandon Forehand);\n* hat-trie C library is updated to the latest version to fix some issues\n with 64bit builds and RHEL (thanks Brandon Forehand and Michael Heilman);\n\n0.1 (2014-03-27)\n----------------\n\nInitial release.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/kmike/hat-trie/", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "hat-trie", "package_url": "https://pypi.org/project/hat-trie/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/hat-trie/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/kmike/hat-trie/" }, "release_url": "https://pypi.org/project/hat-trie/0.3/", "requires_dist": null, "requires_python": null, "summary": "HAT-Trie for Python", "version": "0.3" }, "last_serial": 1945026, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "0bb6ca4109f141486161ce6891c673ee", "sha256": "fce53647f6d9485b118a54828273b43b7fd94223323352f1559df785c88cbefa" }, "downloads": -1, "filename": "hat-trie-0.1.tar.gz", "has_sig": false, "md5_digest": "0bb6ca4109f141486161ce6891c673ee", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21370, "upload_time": "2014-03-27T10:25:39", "url": "https://files.pythonhosted.org/packages/cd/98/a5a302fbc38602e34e9f463cbdbfaf97df11508c541506d39004351e759c/hat-trie-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "54bae23b897e95da01034f9ef83fda98", "sha256": "320f40f957273c5550725a9be09791b7cdb82d7ea151d68bf59237553c588f42" }, "downloads": -1, "filename": "hat-trie-0.2.tar.gz", "has_sig": false, "md5_digest": "54bae23b897e95da01034f9ef83fda98", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 70523, "upload_time": "2014-08-22T15:16:29", "url": "https://files.pythonhosted.org/packages/74/2e/32de4a47d3ee71854ee3915aa60564b67ca32ef9b6b1a3c0cb21bf0bac8b/hat-trie-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "136f1ef8e1f36693e38e8b3635001a86", "sha256": "fa9b0ba04a76c9d30c9a057405ae2475acdd8e30dcc1debee38d1342606afad2" }, "downloads": -1, "filename": "hat_trie-0.3-cp27-none-macosx_10_10_x86_64.whl", "has_sig": false, "md5_digest": "136f1ef8e1f36693e38e8b3635001a86", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 48563, "upload_time": "2016-02-08T04:44:56", "url": "https://files.pythonhosted.org/packages/ba/59/dbd9b096cd80468b500137d3c56c6840ca9fd29fd163c0ad294034255396/hat_trie-0.3-cp27-none-macosx_10_10_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "a358d0e5d25032e15193ae1b3a1e9f43", "sha256": "b8103cb0c814e5fbb4dfa3704daf4c06299abf9e19edec0f1a4e4e0c1fe7cdd4" }, "downloads": -1, "filename": "hat_trie-0.3-cp35-cp35m-macosx_10_11_x86_64.whl", "has_sig": false, "md5_digest": "a358d0e5d25032e15193ae1b3a1e9f43", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 48583, "upload_time": "2016-02-08T04:44:39", "url": "https://files.pythonhosted.org/packages/26/5f/488ea9e2cfdfa84530b6eb04179148c425a297c7f9d94e17d9fbf2d3a63a/hat_trie-0.3-cp35-cp35m-macosx_10_11_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "6c716db2f62d5a07ac55300b19c9a181", "sha256": "403643764538a3692de2664894d9a0567fe6449465d0a623aed514593e74a1f6" }, "downloads": -1, "filename": "hat-trie-0.3.tar.gz", "has_sig": false, "md5_digest": "6c716db2f62d5a07ac55300b19c9a181", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 79886, "upload_time": "2016-02-08T04:44:27", "url": "https://files.pythonhosted.org/packages/fb/69/846a812b7cad00ced7e8ed5c10ffd1eb6b210341d4ee65abbb31d2a0bc17/hat-trie-0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "136f1ef8e1f36693e38e8b3635001a86", "sha256": "fa9b0ba04a76c9d30c9a057405ae2475acdd8e30dcc1debee38d1342606afad2" }, "downloads": -1, "filename": "hat_trie-0.3-cp27-none-macosx_10_10_x86_64.whl", "has_sig": false, "md5_digest": "136f1ef8e1f36693e38e8b3635001a86", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 48563, "upload_time": "2016-02-08T04:44:56", "url": "https://files.pythonhosted.org/packages/ba/59/dbd9b096cd80468b500137d3c56c6840ca9fd29fd163c0ad294034255396/hat_trie-0.3-cp27-none-macosx_10_10_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "a358d0e5d25032e15193ae1b3a1e9f43", "sha256": "b8103cb0c814e5fbb4dfa3704daf4c06299abf9e19edec0f1a4e4e0c1fe7cdd4" }, "downloads": -1, "filename": "hat_trie-0.3-cp35-cp35m-macosx_10_11_x86_64.whl", "has_sig": false, "md5_digest": "a358d0e5d25032e15193ae1b3a1e9f43", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 48583, "upload_time": "2016-02-08T04:44:39", "url": "https://files.pythonhosted.org/packages/26/5f/488ea9e2cfdfa84530b6eb04179148c425a297c7f9d94e17d9fbf2d3a63a/hat_trie-0.3-cp35-cp35m-macosx_10_11_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "6c716db2f62d5a07ac55300b19c9a181", "sha256": "403643764538a3692de2664894d9a0567fe6449465d0a623aed514593e74a1f6" }, "downloads": -1, "filename": "hat-trie-0.3.tar.gz", "has_sig": false, "md5_digest": "6c716db2f62d5a07ac55300b19c9a181", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 79886, "upload_time": "2016-02-08T04:44:27", "url": "https://files.pythonhosted.org/packages/fb/69/846a812b7cad00ced7e8ed5c10ffd1eb6b210341d4ee65abbb31d2a0bc17/hat-trie-0.3.tar.gz" } ] }