{ "info": { "author": "gruzovator", "author_email": "gruzovator@github.com", "bugtrack_url": null, "classifiers": [], "description": "# Boolean Search for Python Containers\n\nLibrary to make simple boolean queries for python string containers (e.g. sets or lists).\nE.g. query built from expression 'Alice & Bob & ~John' can be applied to any container to check if it contains strings 'Alice' and 'Bob' and not contains 'John'.\n\nBase example:\n\n```python\n#!/usr/bin/env python\n\nfrom termsquery import TermsQuery\n\nquery = TermsQuery('Alice & (Bob | \"Unknown user\")')\n\ncontainer1 = {'Alice', 'Unknown user'}\ncontainer2 = {'Bob'}\n\nassert True == query(container1)\nassert False == query(container2)\n```\n\nLibrary can be used to tag collection of documents: create query for each tag\nand apply that query for document words.\n\nSimple tagging example:\n\n```python\n#!/usr/bin/env python\n\nfrom termsquery import TermsQuery\n\ntags = {\n 'A-not-B' : TermsQuery('A & ~B'),\n 'X-and-Y' : TermsQuery('X & Y')\n}\n\ndocs = [\n 'A is the first letter of ...',\n 'A and B letters, X and Y letters'\n]\n\nfor doc in docs:\n words = doc.split()\n doc_tags = [name for (name, query) in tags.items() if query(words)]\n print(doc, doc_tags)\n```", "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/gruzovator/termsquery", "keywords": "boolean expression,logic,expression parser,tagging,tag", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "termsquery", "package_url": "https://pypi.org/project/termsquery/", "platform": "", "project_url": "https://pypi.org/project/termsquery/", "project_urls": { "Homepage": "https://github.com/gruzovator/termsquery" }, "release_url": "https://pypi.org/project/termsquery/0.2/", "requires_dist": null, "requires_python": ">=3", "summary": "Terms boolean expressions to query containers", "version": "0.2" }, "last_serial": 3786657, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "042a98718271688c2f654c8966c1e87a", "sha256": "eaa84dc911a66185c56d8dce419dd68d05e94589cb2b70e765bdf53c712cc3d0" }, "downloads": -1, "filename": "termsquery-0.1.tar.gz", "has_sig": false, "md5_digest": "042a98718271688c2f654c8966c1e87a", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 3421, "upload_time": "2018-03-10T19:24:43", "url": "https://files.pythonhosted.org/packages/a6/ba/c541c703493d3a86f47fcabbe12056b9f05e2e794ce238778dc4e663c962/termsquery-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "2f45d28c1e0f136f13fddf5685d45b77", "sha256": "598bd011d51cf293ee49b5c3049c5797e69b83650272e3579995065b302585f4" }, "downloads": -1, "filename": "termsquery-0.2.tar.gz", "has_sig": false, "md5_digest": "2f45d28c1e0f136f13fddf5685d45b77", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 3851, "upload_time": "2018-04-21T05:04:59", "url": "https://files.pythonhosted.org/packages/63/07/0d4395cd0ffa2312237cc0ffae654019cabf677d95bcc3021b96f15fb9a9/termsquery-0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2f45d28c1e0f136f13fddf5685d45b77", "sha256": "598bd011d51cf293ee49b5c3049c5797e69b83650272e3579995065b302585f4" }, "downloads": -1, "filename": "termsquery-0.2.tar.gz", "has_sig": false, "md5_digest": "2f45d28c1e0f136f13fddf5685d45b77", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 3851, "upload_time": "2018-04-21T05:04:59", "url": "https://files.pythonhosted.org/packages/63/07/0d4395cd0ffa2312237cc0ffae654019cabf677d95bcc3021b96f15fb9a9/termsquery-0.2.tar.gz" } ] }