{ "info": { "author": "Maixent Chenebaux", "author_email": "mchenebaux@reputationsquad.com", "bugtrack_url": null, "classifiers": [ "Operating System :: OS Independent", "Programming Language :: Python :: 3.7" ], "description": "# Boolean text search using Eldar\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your local machine for development and testing purposes.\n\n\n### Prerequisites\n\n* cython\n* unidecode\n\n\n### Installing\n\nYou can install the method by typing:\n```\npip install unidecode -U\npip install cython -U\npip install eldar\n```\n\n### Basic usage\n\n```python\nfrom eldar import build_query\n\n\n# build list\ndocuments = [\n \"Gandalf is a fictional character in Tolkien's The Lord of the Rings\",\n \"Frodo is the main character in The Lord of the Rings\",\n \"Ian McKellen interpreted Gandalf in Peter Jackson's movies\",\n \"Elijah Wood was cast as Frodo Baggins in Jackson's adaptation\",\n \"The Lord of the Rings is an epic fantasy novel by J. R. R. Tolkien\"]\n\neldar = build_query('(\"gandalf\" OR \"frodo\") AND NOT (\"movie\" OR \"adaptation\")')\n\n# use `filter` to get a list of matches:\nprint(eldar.filter(documents))\n# >>> [\"Gandalf is a fictional character in Tolkien's The Lord of the Rings\",\n# 'Frodo is the main character in The Lord of the Rings']\n\n# call to see if the text matches the query:\nprint(eldar(documents[0]))\n# >>> True\nprint(eldar(documents[2]))\n# >>> False\n```\n\n\nYou can also use it to mask Pandas DataFrames:\n```python\nfrom eldar import build_query\nimport pandas as pd\n\n\n# build dataframe\ndf = pd.DataFrame([\n \"Gandalf is a fictional character in Tolkien's The Lord of the Rings\",\n \"Frodo is the main character in The Lord of the Rings\",\n \"Ian McKellen interpreted Gandalf in Peter Jackson's movies\",\n \"Elijah Wood was cast as Frodo Baggins in Jackson's adaptation\",\n \"The Lord of the Rings is an epic fantasy novel by J. R. R. Tolkien\"],\n columns=['content'])\n\n# build query object\neldar = build_query('(\"gandalf\" OR \"frodo\") AND NOT (\"movie\" OR \"adaptation\")')\n\n# eldar's call returns True if the text matches the query.\n# You can filter a dataframe using pandas mask syntax:\ndf = df[df.content.apply(eldar)]\nprint(df)\n```\n\n\n## Authors\n\nMaixent Chenebaux", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/kerighan/eldar", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "eldar", "package_url": "https://pypi.org/project/eldar/", "platform": "", "project_url": "https://pypi.org/project/eldar/", "project_urls": { "Homepage": "https://github.com/kerighan/eldar" }, "release_url": "https://pypi.org/project/eldar/0.0.3/", "requires_dist": null, "requires_python": "", "summary": "Boolean text search in Python", "version": "0.0.3" }, "last_serial": 5995412, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "a9a1d000a9c6ec3bf35e2cf539cefff1", "sha256": "811356fadd57a7ef3db2e8bf431493da3d114627b19f313913cf467c55ce0a6d" }, "downloads": -1, "filename": "eldar-0.0.1.tar.gz", "has_sig": false, "md5_digest": "a9a1d000a9c6ec3bf35e2cf539cefff1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 57925, "upload_time": "2019-10-18T10:12:35", "url": "https://files.pythonhosted.org/packages/42/31/7bbe2c0f469c62ec02b61edb77c5763ad35ec27143b21d425072fd300dc8/eldar-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "0bb5a92e00a209ef2438ed275ad75b90", "sha256": "ffa2a3bae10ee21930e6929168d515f0b4ec997180a62b6dd219571feaff469b" }, "downloads": -1, "filename": "eldar-0.0.2.tar.gz", "has_sig": false, "md5_digest": "0bb5a92e00a209ef2438ed275ad75b90", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 57940, "upload_time": "2019-10-18T10:20:30", "url": "https://files.pythonhosted.org/packages/c0/c3/fce27b93e21f19ecb31659689377de387cfda53308bd0c5c90a42a0d2a4f/eldar-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "d6ded055b1184f94a3589559980ace7d", "sha256": "e0ac03fad2047421c02388c745cb75befc93a697cac8706a787d42eaacbeb68e" }, "downloads": -1, "filename": "eldar-0.0.3.tar.gz", "has_sig": false, "md5_digest": "d6ded055b1184f94a3589559980ace7d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 59566, "upload_time": "2019-10-18T12:32:41", "url": "https://files.pythonhosted.org/packages/d9/34/f6ae0300e6e180e2f222ba8fe5f4b40714ea323d9cb55c28071e12414a8f/eldar-0.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d6ded055b1184f94a3589559980ace7d", "sha256": "e0ac03fad2047421c02388c745cb75befc93a697cac8706a787d42eaacbeb68e" }, "downloads": -1, "filename": "eldar-0.0.3.tar.gz", "has_sig": false, "md5_digest": "d6ded055b1184f94a3589559980ace7d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 59566, "upload_time": "2019-10-18T12:32:41", "url": "https://files.pythonhosted.org/packages/d9/34/f6ae0300e6e180e2f222ba8fe5f4b40714ea323d9cb55c28071e12414a8f/eldar-0.0.3.tar.gz" } ] }