{ "info": { "author": "Kay Zhu", "author_email": "me@kayzhu.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Topic :: Software Development :: Libraries" ], "description": "======\nLSHash\n======\n\n:Version: 0.0.4dev\n\nA fast Python implementation of locality sensitive hashing with persistance\nsupport.\n\nHighlights\n==========\n\n- Fast hash calculation for large amount of high dimensional data through the use of `numpy` arrays.\n- Built-in support for persistency through Redis.\n- Multiple hash indexes support.\n- Built-in support for common distance/objective functions for ranking outputs.\n\nInstallation\n============\n``LSHash`` depends on the following libraries:\n\n- numpy\n- redis (if persistency through Redis is needed)\n- bitarray (if hamming distance is used as distance function)\n\nTo install:\n\n.. code-block:: bash\n\n $ pip install lshash\n\nQuickstart\n==========\nTo create 6-bit hashes for input data of 8 dimensions:\n\n.. code-block:: python\n\n >>> from lshash import LSHash\n\n >>> lsh = LSHash(6, 8)\n >>> lsh.index([1,2,3,4,5,6,7,8])\n >>> lsh.index([2,3,4,5,6,7,8,9])\n >>> lsh.index([10,12,99,1,5,31,2,3])\n >>> lsh.query([1,2,3,4,5,6,7,7])\n [((1, 2, 3, 4, 5, 6, 7, 8), 1.0),\n ((2, 3, 4, 5, 6, 7, 8, 9), 11)]\n\n\nMain Interface\n==============\n\n- To initialize a ``LSHash`` instance:\n\n.. code-block:: python\n\n LSHash(hash_size, input_dim, num_of_hashtables=1, storage=None, matrices_filename=None, overwrite=False)\n\nparameters:\n\n``hash_size``:\n The length of the resulting binary hash.\n``input_dim``:\n The dimension of the input vector.\n``num_hashtables = 1``:\n (optional) The number of hash tables used for multiple lookups.\n``storage = None``:\n (optional) Specify the name of the storage to be used for the index\n storage. Options include \"redis\".\n``matrices_filename = None``:\n (optional) Specify the path to the .npz file random matrices are stored\n or to be stored if the file does not exist yet\n``overwrite = False``:\n (optional) Whether to overwrite the matrices file if it already exist\n\n- To index a data point of a given ``LSHash`` instance, e.g., ``lsh``:\n\n.. code-block:: python\n\n lsh.index(input_point, extra_data=None):\n\nparameters:\n\n``input_point``:\n The input data point is an array or tuple of numbers of input_dim.\n``extra_data = None``:\n (optional) Extra data to be added along with the input_point.\n\n- To query a data point against a given ``LSHash`` instance, e.g., ``lsh``:\n\n.. code-block:: python\n\n lsh.query(query_point, num_results=None, distance_func=\"euclidean\"):\n\nparameters:\n\n``query_point``:\n The query data point is an array or tuple of numbers of input_dim.\n``num_results = None``:\n (optional) The number of query results to return in ranked order. By\n default all results will be returned.\n``distance_func = \"euclidean\"``:\n (optional) Distance function to use to rank the candidates. By default\n euclidean distance function will be used.\n\n\nv0.0.3, 2012/12/28 -- Doc fixes.\nv0.0.2, 2012/12/28 -- Doc fixes and lowercase package name.\nv0.0.1, 2012/12/20 -- Initial release.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "UNKNOWN", "keywords": null, "license": "Copyright 2012 Kay Zhu (a.k.a He Zhu)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.", "maintainer": null, "maintainer_email": null, "name": "lshash", "package_url": "https://pypi.org/project/lshash/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/lshash/", "project_urls": { "Download": "UNKNOWN", "Homepage": "UNKNOWN" }, "release_url": "https://pypi.org/project/lshash/0.0.4dev/", "requires_dist": null, "requires_python": null, "summary": "A fast Python implementation of locality sensitive hashing with persistance support.", "version": "0.0.4dev" }, "last_serial": 794386, "releases": { "0.0.2dev": [ { "comment_text": "", "digests": { "md5": "c04e8d1d53b97e208e30bd1353c0500f", "sha256": "8cb1ff3bcaf3495f514c9c558d7af75b49ee4551208f09d371793e5022b18f8e" }, "downloads": -1, "filename": "lshash-0.0.2dev.tar.gz", "has_sig": false, "md5_digest": "c04e8d1d53b97e208e30bd1353c0500f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7139, "upload_time": "2012-12-28T19:53:07", "url": "https://files.pythonhosted.org/packages/21/c5/beed27120c321011a4c46cb3e3f221c874a36ea892acaf796f7098454440/lshash-0.0.2dev.tar.gz" } ], "0.0.3dev": [ { "comment_text": "", "digests": { "md5": "38bb2a73266e98a004c1f2ca2a07b716", "sha256": "eb27bd558dc2d3ed8c52ba74ddb048c9cfd8da025f0850eb71b75dfb80e03671" }, "downloads": -1, "filename": "lshash-0.0.3dev.tar.gz", "has_sig": false, "md5_digest": "38bb2a73266e98a004c1f2ca2a07b716", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7211, "upload_time": "2012-12-28T20:26:53", "url": "https://files.pythonhosted.org/packages/76/14/a7c145643bbd23478b7c337dc124f315d8347e024c5fcc44b56b7aff2659/lshash-0.0.3dev.tar.gz" } ], "0.0.4dev": [ { "comment_text": "", "digests": { "md5": "c4a7606b4be59ec302b1a19ef8154052", "sha256": "556442ba36f939aec8df7f50ed9251a09a45d434346f94205b2144aa854c7153" }, "downloads": -1, "filename": "lshash-0.0.4dev.tar.gz", "has_sig": false, "md5_digest": "c4a7606b4be59ec302b1a19ef8154052", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7215, "upload_time": "2013-04-27T11:57:56", "url": "https://files.pythonhosted.org/packages/2b/9e/75e5ce8eec67126e4919f2410ccccf84ebd8db90e2cd28d8ffcb05905419/lshash-0.0.4dev.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c4a7606b4be59ec302b1a19ef8154052", "sha256": "556442ba36f939aec8df7f50ed9251a09a45d434346f94205b2144aa854c7153" }, "downloads": -1, "filename": "lshash-0.0.4dev.tar.gz", "has_sig": false, "md5_digest": "c4a7606b4be59ec302b1a19ef8154052", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7215, "upload_time": "2013-04-27T11:57:56", "url": "https://files.pythonhosted.org/packages/2b/9e/75e5ce8eec67126e4919f2410ccccf84ebd8db90e2cd28d8ffcb05905419/lshash-0.0.4dev.tar.gz" } ] }