{ "info": { "author": "Marc-Aurele Coste", "author_email": "", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3 :: Only", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "# Sqla-filters-json\n\nAdd json parser to the sqla-filters package.\n\n## Introduction \n\nThis package \n\n## Installation\n\n```bash\npip install sqla-filter-json\n```\n\n## Getting Started\n\n### JSON format\n\n```json\n{\n \"type\": \"and\",\n \"data\": [\n {\n \"type\": \"or\",\n \"data\": [\n {\n \"type\": \"operator\",\n \"data\": {\n \"attribute\": \"name\",\n \"operator\": \"eq\",\n \"value\": \"toto\"\n }\n },\n {\n \"type\": \"operator\",\n \"data\":{\n \"attribute\": \"name\",\n \"operator\": \"eq\",\n \"value\": \"tata\"\n }\n }\n ]\n },\n {\n \"type\": \"operator\",\n \"data\": {\n \"attribute\": \"age\",\n \"operator\": \"eq\",\n \"value\": 21\n }\n }\n ]\n}\n```\n:warning: Json format can change in the futur. :warning:\n\n\n\nCreate an instance of the JSONFilterParser with the json string.\n\nExample:\n```python\n# Sqlalchemy setup ... + model definition\n\n# Create a JSON parser instance\nparser = JSONFiltersParser(raw_json_string)\n\n# you now have a tree available as a property in the parser\nprint(parser.tree)\n\n# You can finaly filter your query\nquery = session.query(Post)\nfiltered_query = parser.tree.filter(query)\n\n# Get the results\nquery.all()\n```\n\n### Result tree\n\n```\n +----------------------+\n | |\n | and |\n | |\n -----------------------+\n ||\n ||\n ||\n +----------------------+ || +----------------------+\n | | || | |\n | or <------------> age == 21 |\n | | | |\n +----------------------+ +----------------------+\n ||\n ||\n ||\n+----------------------+ || +----------------------+\n| | || | |\n| name == toto <----------------> name == tata |\n| | | |\n+----------------------+ +----------------------+\n```\n\n# Contribute\n\nFork the repository and run the following command to install the dependencies and the dev dependencies.\n\n`pip install -e '.[dev]'`\n\n\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/MarcAureleCoste/sqla-filters-json", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "sqla-filters-json", "package_url": "https://pypi.org/project/sqla-filters-json/", "platform": "", "project_url": "https://pypi.org/project/sqla-filters-json/", "project_urls": { "Homepage": "https://github.com/MarcAureleCoste/sqla-filters-json" }, "release_url": "https://pypi.org/project/sqla-filters-json/0.0.1/", "requires_dist": [ "sqla-filters (==0.0.2)", "pylint; extra == 'dev'", "pep8; extra == 'dev'", "autopep8; extra == 'dev'", "ipython; extra == 'dev'", "mypy; extra == 'dev'", "pytest; extra == 'dev'", "rope; extra == 'dev'", "sphinx; extra == 'dev'", "twine; extra == 'dev'" ], "requires_python": "", "summary": "JSON parser for sqla-filters.", "version": "0.0.1" }, "last_serial": 4352429, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "a64ca17d8c32ae863dbf2b5fa6eba00f", "sha256": "7f463fa0f5044ada29a811d55c5d10687824e6c1e5dddbfc11de02d6f0cf617a" }, "downloads": -1, "filename": "sqla_filters_json-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "a64ca17d8c32ae863dbf2b5fa6eba00f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4414, "upload_time": "2018-10-08T14:56:31", "url": "https://files.pythonhosted.org/packages/02/37/e83e5430d01c511c332d42d0b638e1da2cecf1e0bc7ed8855dae477321fc/sqla_filters_json-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ae458a09b61003e63b9abfa4a2de140d", "sha256": "77bd2ba08e53b9c2960744a1665f48c7174313ac164dea2538241d739532834e" }, "downloads": -1, "filename": "sqla-filters-json-0.0.1.tar.gz", "has_sig": false, "md5_digest": "ae458a09b61003e63b9abfa4a2de140d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4254, "upload_time": "2018-10-08T14:56:33", "url": "https://files.pythonhosted.org/packages/2d/fb/3ecf01ce086551c59ce0975b57d5bd08fada267229b30d3cac887b1b13dc/sqla-filters-json-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a64ca17d8c32ae863dbf2b5fa6eba00f", "sha256": "7f463fa0f5044ada29a811d55c5d10687824e6c1e5dddbfc11de02d6f0cf617a" }, "downloads": -1, "filename": "sqla_filters_json-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "a64ca17d8c32ae863dbf2b5fa6eba00f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4414, "upload_time": "2018-10-08T14:56:31", "url": "https://files.pythonhosted.org/packages/02/37/e83e5430d01c511c332d42d0b638e1da2cecf1e0bc7ed8855dae477321fc/sqla_filters_json-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ae458a09b61003e63b9abfa4a2de140d", "sha256": "77bd2ba08e53b9c2960744a1665f48c7174313ac164dea2538241d739532834e" }, "downloads": -1, "filename": "sqla-filters-json-0.0.1.tar.gz", "has_sig": false, "md5_digest": "ae458a09b61003e63b9abfa4a2de140d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4254, "upload_time": "2018-10-08T14:56:33", "url": "https://files.pythonhosted.org/packages/2d/fb/3ecf01ce086551c59ce0975b57d5bd08fada267229b30d3cac887b1b13dc/sqla-filters-json-0.0.1.tar.gz" } ] }