{ "info": { "author": "Tan Shuai", "author_email": "7anshuai@gmail.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "pyreds\n======\n\n`reds `_ is a light-weight Redis Search for Node.js.\n\npyreds is a Python port of reds.\n\nInstallation\n------------\n\npyreds requires a running Redis server. See `Redis's quickstart\n`_ for installation instructions.\n\nTo install pyreds, simply:\n\n.. code-block:: bash\n\n $ pip install pyreds\n\nYou may need install NLTK Data:\n\n.. code-block:: pycon\n\n >>> import nltk\n >>> nltk.download('stopwords')\n\nGetting Started\n---------------\n\nThe first thing you'll want to do is create a `Search` instance, which allow you to pass a `key`, used for namespacing within Redis so that you may have several searches in the same db.\n \n.. code-block:: pycon\n\n >>> import pyreds\n >>> search = pyreds.create_search('pets')\n\npyreds acts against arbitrary numeric or string based ids, so you could utilize this library with essentially anything you wish, even combining data stores. The following example just uses a list for our \"database\", containing some strings, which we add to pyreds by calling `Search#index()` padding the body of text and an id of some kind, in this case the index.\n\n.. code-block:: pycon\n\n >>> strs = []\n >>> strs.append('Tobi wants four dollars')\n >>> strs.append('Tobi only wants $4')\n >>> strs.append('Loki is really fat')\n >>> strs.append('Loki, Jane, and Tobi are ferrets')\n >>> strs.append('Manny is a cat')\n >>> strs.append('Luna is a cat')\n >>> strs.append('Mustachio is a cat')\n >>> for i, v in enumerate(strs):\n ... search.index(v, i)\n\nTo perform a query against pyreds simply invoke `Search#query()` with a string, which return a `Query` instance. Then invoke `Query#end()`, which return a list of ids when present, or an empty list otherwise.\n\n.. code-block:: pycon\n\n >>> ids = search.query('Tobi dollars').end()\n >>> print('Search results for \"Tobi dollars\"'))\n >>> for id in ids:\n ... print(' - {}'.format(strs[id]))\n\nBy default pyreds performs an intersection of the search words. The previous example would yield the following output since only one string contains both \"Tobi\" and \"dollars\":\n\n.. code-block:: pycon\n\n Search results for \"Tobi dollars\":\n - Tobi wants four dollars\n\nWe can tweak pyreds to perform a union by passing either \"union\" or \"or\" to `Search#type()` between `Search#query()` and `Query#end()`, indicating that any of the constants computed may be present for the id to match.\n\n.. code-block:: pycon\n\n >>> ids = search.query('tobi dollars').type('or').end()\n >>> print('Search results for \"Tobi dollars\"'))\n >>> for id in ids:\n ... print(' - {}'.format(strs[id]))\n\nThe union search would yield the following since three strings contain either \"Tobi\" or \"dollars\":\n\n.. code-block:: pycon\n\n Search results for \"tobi dollars\":\n - Tobi wants four dollars\n - Tobi only wants $4\n - Loki, Jane, and Tobi are ferrets\n\nAPI\n---\n\n.. code-block:: pycon\n\n >>> search = pyreds.create_search(key)\n >>> search.index(text, id)\n >>> search.remove(id)\n >>> query = search.query(text[, type]) # will return a `Query` instance\n >>>\n >>> query.between(start, stop)\n >>> query.type(type)\n >>> query.end()\n\nLICENSE\n-------\n\nThe MIT License", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/7anshuai/pyreds/archive/0.1.3.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/7anshuai/pyreds", "keywords": "redis,full text search", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "pyreds", "package_url": "https://pypi.org/project/pyreds/", "platform": "", "project_url": "https://pypi.org/project/pyreds/", "project_urls": { "Download": "https://github.com/7anshuai/pyreds/archive/0.1.3.tar.gz", "Homepage": "https://github.com/7anshuai/pyreds" }, "release_url": "https://pypi.org/project/pyreds/0.1.3/", "requires_dist": null, "requires_python": "", "summary": "Simple full text search module for Python, backed by Redis", "version": "0.1.3" }, "last_serial": 3433975, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "698e25808cda28ac48049cafcb7d0105", "sha256": "a1abe51489d7754a1a83f4297c1f67a599cceb5c31d706a807e534acc3ba9e4a" }, "downloads": -1, "filename": "pyreds-0.1.1.tar.gz", "has_sig": false, "md5_digest": "698e25808cda28ac48049cafcb7d0105", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8299, "upload_time": "2017-12-20T05:43:27", "url": "https://files.pythonhosted.org/packages/a0/2c/d8e9ac0999c3335c3602b3112dd168eb85cfd39d496b7bc9a2be93857922/pyreds-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "05fb7a97c18f0c012473035cf90771c4", "sha256": "45a6993545db3a2a3f30bdc0efa6bd87c7773919dbafe235d58e85bf56cf6344" }, "downloads": -1, "filename": "pyreds-0.1.2.tar.gz", "has_sig": false, "md5_digest": "05fb7a97c18f0c012473035cf90771c4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8413, "upload_time": "2017-12-21T08:06:33", "url": "https://files.pythonhosted.org/packages/96/c7/30c8382d1d6f7d46f5412365448adabd927d80ba314875e152faf2624318/pyreds-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "8e52c0b47b07d8388a516ceeb6b98f8c", "sha256": "c7f6c9275210f89952e73121401a34175e72e6d895d1e45307c8f82b2a002dd5" }, "downloads": -1, "filename": "pyreds-0.1.3.tar.gz", "has_sig": false, "md5_digest": "8e52c0b47b07d8388a516ceeb6b98f8c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8394, "upload_time": "2017-12-21T10:17:38", "url": "https://files.pythonhosted.org/packages/7f/30/34f0c8ca9b5adb98225f23f26b8ee0820b73ef5bc57806708ead251272ff/pyreds-0.1.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8e52c0b47b07d8388a516ceeb6b98f8c", "sha256": "c7f6c9275210f89952e73121401a34175e72e6d895d1e45307c8f82b2a002dd5" }, "downloads": -1, "filename": "pyreds-0.1.3.tar.gz", "has_sig": false, "md5_digest": "8e52c0b47b07d8388a516ceeb6b98f8c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8394, "upload_time": "2017-12-21T10:17:38", "url": "https://files.pythonhosted.org/packages/7f/30/34f0c8ca9b5adb98225f23f26b8ee0820b73ef5bc57806708ead251272ff/pyreds-0.1.3.tar.gz" } ] }