{ "info": { "author": "Ben Hoyt", "author_email": "benhoyt@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "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" ], "description": "pybktree\n========\n\npybktree is a generic, pure Python implementation of a `BK-tree`_ data\nstructure, which allows fast querying of \"close\" matches (for example, matches\nwith small hamming distance or Levenshtein distance). This module is based on\nthe algorithm by Nick Johnson in his `blog article on BK-trees`_.\n\nThe library is `on the Python Package Index (PyPI)`_ and works on both Python\n3 and Python 2.7. To install it, fire up a command prompt, activate your\nvirtual environment if you're using one, and type:\n\n::\n\n pip install pybktree\n\nExample usage:\n\n.. code:: python\n\n >>> tree = pybktree.BKTree(pybktree.hamming_distance, [0, 4, 5, 14])\n >>> tree.add(15) # add element 15\n >>> sorted(tree) # BKTree instances are iterable\n [0, 4, 5, 14, 15]\n >>> sorted(tree.find(13, 1)) # find elements at most 1 bit away from element 13\n [(1, 5), (1, 15)]\n\nFor large trees and fairly small N when calling ``find()``, using a BKTree is\nmuch faster than doing a linear search. This is especially good when you're\nde-duping a few hundred thousand photos -- with a linear search that would\nbecome a very slow, O(N\u00b2) operation. With a BKTree, it's more like O(N log N).\n\nRead the code in `pybktree.py`_ for more details \u2013 it's pretty small!\n\nOther BK-tree modules I found on GitHub while writing this one:\n\n* `ahupp/bktree`_: this one is pretty good, but it's not on PyPI, and it's\n recursive\n* `ryanfox/bktree`_: this one is hard to customize, ``search()`` doesn't\n return distances, it's slower, and was buggy (though I think he fixed it\n recently)\n\npybktree was written by `Ben Hoyt`_ for `Jetsetter`_ and is licensed with a\npermissive MIT license (see `LICENSE.txt`_).\n\n\n.. _BK-tree: https://en.wikipedia.org/wiki/BK-tree\n.. _blog article on BK-trees: http://blog.notdot.net/2007/4/Damn-Cool-Algorithms-Part-1-BK-Trees\n.. _on the Python Package Index (PyPI): https://pypi.python.org/pypi/pybktree\n.. _pybktree.py: https://github.com/Jetsetter/pybktree/blob/master/pybktree.py\n.. _ahupp/bktree: https://github.com/ahupp/bktree\n.. _ryanfox/bktree: https://github.com/ryanfox/bktree\n.. _Ben Hoyt: http://benhoyt.com/\n.. _Jetsetter: http://www.jetsetter.com/\n.. _LICENSE.txt: https://github.com/Jetsetter/pybktree/blob/master/LICENSE.txt\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Jetsetter/pybktree", "keywords": "", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "pybktree", "package_url": "https://pypi.org/project/pybktree/", "platform": "", "project_url": "https://pypi.org/project/pybktree/", "project_urls": { "Homepage": "https://github.com/Jetsetter/pybktree" }, "release_url": "https://pypi.org/project/pybktree/1.1/", "requires_dist": null, "requires_python": "", "summary": "BK-tree data structure to allow fast querying of \"close\" matches", "version": "1.1" }, "last_serial": 3114719, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "80a73b51f7866533be95c9c4bd652793", "sha256": "c86598ead321ae9bc51e11188ed02f7905670f33796653a940e29cb6441ccecd" }, "downloads": -1, "filename": "pybktree-1.0.tar.gz", "has_sig": false, "md5_digest": "80a73b51f7866533be95c9c4bd652793", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4412, "upload_time": "2017-01-31T19:37:26", "url": "https://files.pythonhosted.org/packages/b8/33/c060be10dd06230a6e89ee0defc2c499f069f31627154ff615bab331c0dc/pybktree-1.0.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "9c809214fc979391fdd75dae1942cfb2", "sha256": "eec0037cdd3d7553e6d72435a4379bede64be17c6712f149e485169638154d2b" }, "downloads": -1, "filename": "pybktree-1.1.tar.gz", "has_sig": false, "md5_digest": "9c809214fc979391fdd75dae1942cfb2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4544, "upload_time": "2017-08-22T13:38:02", "url": "https://files.pythonhosted.org/packages/6b/38/a5fba29cf727ca8249d3840016e1f7919896111aa28d2cb96f013eaa480d/pybktree-1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9c809214fc979391fdd75dae1942cfb2", "sha256": "eec0037cdd3d7553e6d72435a4379bede64be17c6712f149e485169638154d2b" }, "downloads": -1, "filename": "pybktree-1.1.tar.gz", "has_sig": false, "md5_digest": "9c809214fc979391fdd75dae1942cfb2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4544, "upload_time": "2017-08-22T13:38:02", "url": "https://files.pythonhosted.org/packages/6b/38/a5fba29cf727ca8249d3840016e1f7919896111aa28d2cb96f013eaa480d/pybktree-1.1.tar.gz" } ] }