{ "info": { "author": "Allison Parrish", "author_email": "allison@decontextualize.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "Intended Audience :: Education", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Topic :: Artistic Software", "Topic :: Software Development :: Libraries" ], "description": "Simple Neighbors\n================\n\n.. image:: https://img.shields.io/travis/aparrish/simpleneighbors.svg\n :target: https://travis-ci.org/aparrish/simpleneighbors\n\n.. image:: https://coveralls.io/repos/github/aparrish/simpleneighbors/badge.svg?branch=master\n :target: https://coveralls.io/github/aparrish/simpleneighbors?branch=master\n\n.. image:: https://img.shields.io/pypi/v/simpleneighbors.svg\n :target: https://pypi.python.org/pypi/simpleneighbors\n\nSimple Neighbors is a clean and easy interface for performing nearest-neighbor\nlookups on items from a corpus. For example, here's how to find the most\nsimilar color to a color in the `xkcd colors list\n`_::\n\n >>> from simpleneighbors import SimpleNeighbors\n >>> import json\n >>> color_data = json.load(open('xkcd.json'))['colors']\n >>> hex2int = lambda s: [int(s[n:n+2], 16) for n in range(1,7,2)]\n >>> colors = [(item['color'], hex2int(item['hex'])) for item in color_data]\n >>> sim = SimpleNeighbors(3)\n >>> sim.feed(colors)\n >>> sim.build()\n >>> list(sim.neighbors('pink', 5))\n ['pink', 'bubblegum pink', 'pale magenta', 'dark mauve', 'light plum']\n\nRead the documentation here: https://simpleneighbors.readthedocs.org.\n\nApproximate nearest-neighbor lookups are a quick way to find the items in your\ndata set that are closest (or most similar to) any other item in your data, or\nan arbitrary point in the space that your data defines. Your data items might\nbe colors in a (R, G, B) space, or sprites in a (X, Y) space, or word vectors\nin a 300-dimensional space.\n\nYou could always perform pairwise distance calculations to find nearest\nneighbors in your data, but for data of any appreciable size and complexity,\nthis kind of calculation is unbearably slow. This library uses `Annoy\n`_ behind the scenes for approximate\nnearest-neighbor lookups, which are ultimately a little less accurate than\npairwise calculations but much, much faster.\n\nThe library also keeps track of your data, sparing you the extra step of\nmapping each item in your data to its integer index in Annoy (at the potential\ncost of some redundancy in data storage, depending on your application).\n\nI made Simple Neighbors because I use Annoy all the time and found myself\nwriting and rewriting the same bits of wrapper code over and over again. I\nwanted to hide a little bit of the complexity of using Annoy to make it easier\nto build small prototypes and teach workshops using nearest-neighbor lookups.\n\nInstallation\n------------\n\nInstall with pip like so::\n\n pip install simpleneighbors\n\nYou can also download the source code and install manually::\n\n python setup.py install\n\n\n\n\n\nHistory\n=======\n\n0.0.1 (2018-07-13)\n------------------\n\n* Initial release.\n\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/aparrish/simpleneighbors", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "simpleneighbors", "package_url": "https://pypi.org/project/simpleneighbors/", "platform": "any", "project_url": "https://pypi.org/project/simpleneighbors/", "project_urls": { "Homepage": "https://github.com/aparrish/simpleneighbors" }, "release_url": "https://pypi.org/project/simpleneighbors/0.0.1/", "requires_dist": [ "annoy" ], "requires_python": "", "summary": "A clean and easy interface for nearest-neighbors lookup", "version": "0.0.1" }, "last_serial": 4058827, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "42b52ad37e69fbd32a0fb3dee5296fd5", "sha256": "985402585d63859867d67a9d9527653ee6760b7db77bc9f2d52e5093437a4829" }, "downloads": -1, "filename": "simpleneighbors-0.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "42b52ad37e69fbd32a0fb3dee5296fd5", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6880, "upload_time": "2018-07-13T17:57:07", "url": "https://files.pythonhosted.org/packages/a2/8e/b8ca38e4305bdf5c4cac5d9bf4b65022a2d3641a978b28ce92f9e4063c7b/simpleneighbors-0.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "56a175af44f6ab572634524bf3f6aa47", "sha256": "5f74562ab6dee49c98cba5ee0feb36bd6d38d49979f04f1775abba1672a99520" }, "downloads": -1, "filename": "simpleneighbors-0.0.1.tar.gz", "has_sig": false, "md5_digest": "56a175af44f6ab572634524bf3f6aa47", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12977, "upload_time": "2018-07-13T17:57:08", "url": "https://files.pythonhosted.org/packages/0c/05/e0d0876a71c72878d76db6ed7f007af6346a2fcf6be714b71b64ef60bd97/simpleneighbors-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "42b52ad37e69fbd32a0fb3dee5296fd5", "sha256": "985402585d63859867d67a9d9527653ee6760b7db77bc9f2d52e5093437a4829" }, "downloads": -1, "filename": "simpleneighbors-0.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "42b52ad37e69fbd32a0fb3dee5296fd5", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6880, "upload_time": "2018-07-13T17:57:07", "url": "https://files.pythonhosted.org/packages/a2/8e/b8ca38e4305bdf5c4cac5d9bf4b65022a2d3641a978b28ce92f9e4063c7b/simpleneighbors-0.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "56a175af44f6ab572634524bf3f6aa47", "sha256": "5f74562ab6dee49c98cba5ee0feb36bd6d38d49979f04f1775abba1672a99520" }, "downloads": -1, "filename": "simpleneighbors-0.0.1.tar.gz", "has_sig": false, "md5_digest": "56a175af44f6ab572634524bf3f6aa47", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12977, "upload_time": "2018-07-13T17:57:08", "url": "https://files.pythonhosted.org/packages/0c/05/e0d0876a71c72878d76db6ed7f007af6346a2fcf6be714b71b64ef60bd97/simpleneighbors-0.0.1.tar.gz" } ] }