{ "info": { "author": "Gal Matijevic", "author_email": "gmatijevic@aip.de", "bugtrack_url": null, "classifiers": [], "description": "queryparser\n===========\n\n**Tool for parsing and processing MySQL and ADQL SELECT queries**\n\nDesigned to be used in conjunction with `django-daiquri `_\nas a query processing backend but it can be easily used as a stand-alone tool\nor integrated into another project.\n\n.. image:: https://travis-ci.org/aipescience/queryparser.svg?branch=master\n :alt: Build Status\n :target: https://travis-ci.org/aipescience/queryparser\n\n.. image:: https://coveralls.io/repos/github/aipescience/queryparser/badge.svg?branch=master\n :alt: Coverage Status\n :target: https://coveralls.io/github/aipescience/queryparser?branch=master\n\n.. image:: https://img.shields.io/pypi/v/queryparser-python3.svg?style=flat\n :alt: Latest Version\n :target: https://pypi.python.org/pypi/queryparser-python3/\n\n.. image:: http://img.shields.io/badge/license-APACHE-blue.svg?style=flat\n :target: https://github.com/adrn/schwimmbad/blob/master/LICENSE\n\n\nInstallation\n------------\n\nThe easiest way to install the package is by using the pip tool:\n\n.. code-block:: shell\n\n pip install queryparser-python3\n\nor if you are using an older version (2.7) of python\n\n.. code-block:: shell\n\n pip install queryparser-python2\n\nAlternatively, you can clone the repository and install it from there.\nHowever, this step also requires generating the parser which is a slighly\nmore elaborate process (see below).\n\n\nGenerating the parser from the git repository\n---------------------------------------------\n\nTo generate the parsers you need `python` (either 2 or 3), `java` above version \n7, and `antlr4` (`antlr-4.*-complete.jar` has to be installed inside the \n`/usr/local/lib/` or `/usr/local/bin/` directories).\n\nAfter cloning the project run\n\n.. code-block:: bash\n\n make\n\nand a `lib` directory will be created with the complete source for python2\nand python3. After that run\n\n.. code-block:: bash\n\n python setup.py install\n\nto install the generated parser in your virtual environment.\n\n\nParsing MySQL\n-------------\n\nParsing and processing of MySQL queries can be done by creating an instance\nof the ``MySQLQueryProcessor`` class\n\n.. code-block:: python\n\n from queryparser.mysql import MySQLQueryProcessor\n\n qp = MySQLQueryProcessor()\n\nfeeding it a MySQL query\n\n.. code-block:: python\n\n sql = \"SELECT a FROM db.tab;\"\n qp.set_query(sql)\n\nand running it with\n\n.. code-block:: python\n\n qp.process_query()\n\nAfter the processing, the processor object ``qp`` will include tables, columns,\nfunctions, and keywords used in the query or will raise a ``QuerySyntaxError``\nif there are any syntax errors in the query.\n\nAlternatively, passing the query at initialization automatically processes it.\n\n\nTranslating ADQL\n----------------\n\nTranslation of ADQL queries is done similarly by first creating an instance of\nthe ``ADQLQueryTranslator`` class\n\n.. code-block:: python\n\n from queryparser.adql import ADQLQueryTranslator\n\n adql = \"SELECT TOP 100 POINT('ICRS', ra, de) FROM db.tab;\"\n adt = ADQLQueryTranslator(adql)\n\nand calling\n\n.. code-block:: python\n\n adt.to_mysql()\n\nwhich returns a translated string representing a valid MySQL query if\nthe ADQL query had no errors. The MySQL query can then be parsed with the\n``MySQLQueryProcessor`` in the same way as shown above.\n\n\nTesting\n-------\n\nFirst, install `pytest`\n\n.. code-block:: bash\n\n pip install pytest\n\nthen run the test suite for a version of python you would like to test with\n\n.. code-block:: bash\n \n pytest lib/python2\n pytest lib/python3", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/aipescience/queryparser", "keywords": "", "license": "Apache-2.0", "maintainer": "Gal Matijevic", "maintainer_email": "gmatijevic@aip.de", "name": "queryparser-python2", "package_url": "https://pypi.org/project/queryparser-python2/", "platform": "", "project_url": "https://pypi.org/project/queryparser-python2/", "project_urls": { "Homepage": "https://github.com/aipescience/queryparser" }, "release_url": "https://pypi.org/project/queryparser-python2/0.4.2/", "requires_dist": null, "requires_python": "", "summary": "Parses MySQL and translates ADQL to MySQL.", "version": "0.4.2" }, "last_serial": 4407055, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "b9026bc4f9424e4db3e03d375c294407", "sha256": "f27309f35d926875ff509b48c82d9be4c5fa3bc64978d1a5069d6e3b2f7e2690" }, "downloads": -1, "filename": "queryparser-python2-0.1.tar.gz", "has_sig": false, "md5_digest": "b9026bc4f9424e4db3e03d375c294407", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 216782, "upload_time": "2017-08-11T10:58:57", "url": "https://files.pythonhosted.org/packages/c2/14/49c1892276dfa976a4bf40a3bbbfceec1e09ecf215ca3b5642b4a09eeea1/queryparser-python2-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "23b0a31e59676a5b47698d6636006345", "sha256": "54cb4224ad524aecb019b136a7cea0e0d2f43fc9bfa14d8eebd8ab675bd11911" }, "downloads": -1, "filename": "queryparser-python2-0.1.1.tar.gz", "has_sig": false, "md5_digest": "23b0a31e59676a5b47698d6636006345", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 210511, "upload_time": "2017-08-15T14:20:07", "url": "https://files.pythonhosted.org/packages/cd/eb/521e66baae13bf3eb835bc3671cf61079310d38304f7b120120ef9aee6c4/queryparser-python2-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "84624d433a65b0eddbb0f389b581c39c", "sha256": "4d9d876708c647b91f4eda814357c74d0f3596b2c6761a6ec79fd8fb4055b635" }, "downloads": -1, "filename": "queryparser-python2-0.1.2.tar.gz", "has_sig": false, "md5_digest": "84624d433a65b0eddbb0f389b581c39c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 209644, "upload_time": "2017-08-18T15:00:39", "url": "https://files.pythonhosted.org/packages/3f/20/658fe0251f0f0f373bab88dd4fee19829d3c6789de8231ae40efb56523a2/queryparser-python2-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "435f49d59957c004ee552a65cd698bb5", "sha256": "69978def7b5aca8de69e7bcf573f43ceaa8f3ee66c534a79bd2f254ea5df7fa6" }, "downloads": -1, "filename": "queryparser-python2-0.1.3.tar.gz", "has_sig": false, "md5_digest": "435f49d59957c004ee552a65cd698bb5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 211588, "upload_time": "2017-08-24T09:30:28", "url": "https://files.pythonhosted.org/packages/d0/a4/c1d399e96be11534e50bd8b375a25f3e499f5ae897b246a0d2e048d88d1d/queryparser-python2-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "24750b4e7593a674d95e71e0701201eb", "sha256": "f323a828a81b1e9080fb4383685869025b6d629b91c9bd480a256935f11cdbb8" }, "downloads": -1, "filename": "queryparser-python2-0.1.4.tar.gz", "has_sig": false, "md5_digest": "24750b4e7593a674d95e71e0701201eb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 211561, "upload_time": "2017-08-24T09:37:05", "url": "https://files.pythonhosted.org/packages/8e/f8/be5ef063f7e12da375cab4b5d003183c2a0d05ff0af6d7cfecdbb1ec85bd/queryparser-python2-0.1.4.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "f3af298a0f51fdcdf1e84ce177d0ea12", "sha256": "784d32a91e2a904f53aaeeca6d2ad1bd927f8ab8b47307b7b9aabb5b9fe6087d" }, "downloads": -1, "filename": "queryparser-python2-0.2.0.tar.gz", "has_sig": false, "md5_digest": "f3af298a0f51fdcdf1e84ce177d0ea12", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 212537, "upload_time": "2017-08-31T11:25:06", "url": "https://files.pythonhosted.org/packages/22/2c/6f566967c704df94a932ccc04d7f47b36ae5d771f9038924de8d56559e44/queryparser-python2-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "825baaab811fc0d371a40f42382150c9", "sha256": "d2149a4ae22ba023e4c9a6808a06576105043d961caf21d2e1517ec0cba4fbaf" }, "downloads": -1, "filename": "queryparser-python2-0.2.1.tar.gz", "has_sig": false, "md5_digest": "825baaab811fc0d371a40f42382150c9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 213920, "upload_time": "2017-09-05T12:09:55", "url": "https://files.pythonhosted.org/packages/d8/b9/1ff2993cdf3099d3a9f428237a435a9951b941b69d3b23567fd9fcdffc1f/queryparser-python2-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "e383cc4c0bd300b25862b6db4d48bc2d", "sha256": "ac4d15ca41bc17cbb62f839b736f3ea6d83139d579137d18ee0d0b6cd7afdd3c" }, "downloads": -1, "filename": "queryparser-python2-0.2.2.tar.gz", "has_sig": false, "md5_digest": "e383cc4c0bd300b25862b6db4d48bc2d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 215289, "upload_time": "2017-09-12T13:56:14", "url": "https://files.pythonhosted.org/packages/a1/a2/d75359cbc7ae3e875ab3d42951b80b73b98cffbcaf1e09bbd31f1a97dc10/queryparser-python2-0.2.2.tar.gz" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "9acee1891fcc46328a9163225e90aba5", "sha256": "be50cbcd3f34118a0d164240359f269fbf0bb143ce4d2d473b691a95c47d1124" }, "downloads": -1, "filename": "queryparser-python2-0.2.3.tar.gz", "has_sig": false, "md5_digest": "9acee1891fcc46328a9163225e90aba5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 215666, "upload_time": "2017-09-18T13:43:18", "url": "https://files.pythonhosted.org/packages/05/71/12a849ec1df9e8daf659012d68241eceb604cdc256049c68de6563e949d4/queryparser-python2-0.2.3.tar.gz" } ], "0.2.4": [ { "comment_text": "", "digests": { "md5": "5b2c240b3ad1f40dd0fe19e64cd95754", "sha256": "f94e8fa53d24ea7925f65328606d825eed29cdf383b4388ba9fc87962b36b66a" }, "downloads": -1, "filename": "queryparser-python2-0.2.4.tar.gz", "has_sig": false, "md5_digest": "5b2c240b3ad1f40dd0fe19e64cd95754", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 216593, "upload_time": "2017-09-25T08:51:55", "url": "https://files.pythonhosted.org/packages/2e/57/20d575dc158cd2c817438d792bbc0275ee9dc9d3a103259f584474425874/queryparser-python2-0.2.4.tar.gz" } ], "0.2.5": [ { "comment_text": "", "digests": { "md5": "626d38ed085ae5c307fbe4948e6dae18", "sha256": "3ef2c8aed0f6089409ec2792611bd7e5a0e0a950fe462cc6176818a15a83dabb" }, "downloads": -1, "filename": "queryparser-python2-0.2.5.tar.gz", "has_sig": false, "md5_digest": "626d38ed085ae5c307fbe4948e6dae18", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 305280, "upload_time": "2018-02-17T08:00:00", "url": "https://files.pythonhosted.org/packages/2e/4d/d37de3be7ed5cd046b37c971b525d2b8ea3bf205040861273c428a442994/queryparser-python2-0.2.5.tar.gz" } ], "0.2.6": [ { "comment_text": "", "digests": { "md5": "e13b9d97fccc9e6e49289d04a0d1d9eb", "sha256": "7f9f25f80b7b4a530f34c9f7e03b2967387e26c450686a29c81fd42b9b2de742" }, "downloads": -1, "filename": "queryparser-python2-0.2.6.tar.gz", "has_sig": false, "md5_digest": "e13b9d97fccc9e6e49289d04a0d1d9eb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 305252, "upload_time": "2018-02-23T14:32:27", "url": "https://files.pythonhosted.org/packages/97/b8/aa5e28f59c33f98056feb95d2f84460915979b7c91ca83c3b187839bb912/queryparser-python2-0.2.6.tar.gz" } ], "0.2.7": [ { "comment_text": "", "digests": { "md5": "dad95d06aa3a96f1b921b07ce20cc282", "sha256": "7f9a42816716ab796b615f2fe62143ea9b8617c74694c3abc4b1e4a00a4fbb38" }, "downloads": -1, "filename": "queryparser-python2-0.2.7.tar.gz", "has_sig": false, "md5_digest": "dad95d06aa3a96f1b921b07ce20cc282", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 305706, "upload_time": "2018-04-05T11:00:13", "url": "https://files.pythonhosted.org/packages/3f/8f/4c19ad96033bc8c7039e7242f26d59734658e711df6615ec5e538568f481/queryparser-python2-0.2.7.tar.gz" } ], "0.2.8": [ { "comment_text": "", "digests": { "md5": "e4afa1e7441bb776b3f5a8af31f7710e", "sha256": "085a491216b3ccd53fa51bd315921fb215620dd93d0ef76550f8e08f9bb678fb" }, "downloads": -1, "filename": "queryparser-python2-0.2.8.tar.gz", "has_sig": false, "md5_digest": "e4afa1e7441bb776b3f5a8af31f7710e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 306684, "upload_time": "2018-04-18T15:57:06", "url": "https://files.pythonhosted.org/packages/2f/41/dc1acf07b122ae70947d134adad0e2c16013cfacb60350f4efa3ba923f26/queryparser-python2-0.2.8.tar.gz" } ], "0.2.9": [ { "comment_text": "", "digests": { "md5": "5307a8fdfa05f1ef0492f6e0439408d4", "sha256": "70349aabcb9dff197b0a6590a1536c0faaf71ac6fb336a0db915b935d3ccc639" }, "downloads": -1, "filename": "queryparser-python2-0.2.9.tar.gz", "has_sig": false, "md5_digest": "5307a8fdfa05f1ef0492f6e0439408d4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 306841, "upload_time": "2018-04-21T13:26:07", "url": "https://files.pythonhosted.org/packages/17/75/5cadee0702ada8878b3fc8c088d5f5f87a7a92ee7b076967d36d1d47a1f1/queryparser-python2-0.2.9.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "03503bb5eb036765f2b702f703f7e1b3", "sha256": "9d0990a13a12ef1d26bb794095e4f2a7c93395688f3b4e1cc6547d51c9c388a0" }, "downloads": -1, "filename": "queryparser-python2-0.3.tar.gz", "has_sig": false, "md5_digest": "03503bb5eb036765f2b702f703f7e1b3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 308056, "upload_time": "2018-04-25T08:06:32", "url": "https://files.pythonhosted.org/packages/01/8e/6bde47c4bda53d4de64de94cbd21357ff3baa4c8e75f2fa9a1af11259ed2/queryparser-python2-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "ccbd973ed08e659dfb450ddd9db4c6dc", "sha256": "6bdb5094844aaa43caece62490edc820071db1b8dc96d7adb0e0c4465515c803" }, "downloads": -1, "filename": "queryparser-python2-0.4.tar.gz", "has_sig": false, "md5_digest": "ccbd973ed08e659dfb450ddd9db4c6dc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 308766, "upload_time": "2018-10-12T08:54:47", "url": "https://files.pythonhosted.org/packages/ef/76/cf870aed83487fa4d35bd307ef21abc03e5575965e5d7eff2d1bb7ff62cb/queryparser-python2-0.4.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "cfcaddc62e0871b618d029b3b68fb0ea", "sha256": "d0bc53d2b2089452bd8e5c2f993ad67eb3d48b624487f7cf78b501559de8f60b" }, "downloads": -1, "filename": "queryparser-python2-0.4.1.tar.gz", "has_sig": false, "md5_digest": "cfcaddc62e0871b618d029b3b68fb0ea", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 308810, "upload_time": "2018-10-12T11:28:20", "url": "https://files.pythonhosted.org/packages/26/73/4e9f6a90c05ddb983b0ee058e6a9aac4a621144a1d5771cc980ebff25d38/queryparser-python2-0.4.1.tar.gz" } ], "0.4.2": [ { "comment_text": "", "digests": { "md5": "fd0f3de050e51d615682a00d0ddce857", "sha256": "1c63ff52b9d21896f7c1a619fc4f2f84c832971b7b6c3a3e8d273224bc9f3088" }, "downloads": -1, "filename": "queryparser-python2-0.4.2.tar.gz", "has_sig": false, "md5_digest": "fd0f3de050e51d615682a00d0ddce857", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 308918, "upload_time": "2018-10-23T16:18:23", "url": "https://files.pythonhosted.org/packages/f4/92/9f83e21a1f43844474ef20e945df639c859439a074026a458563d89e3a55/queryparser-python2-0.4.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "fd0f3de050e51d615682a00d0ddce857", "sha256": "1c63ff52b9d21896f7c1a619fc4f2f84c832971b7b6c3a3e8d273224bc9f3088" }, "downloads": -1, "filename": "queryparser-python2-0.4.2.tar.gz", "has_sig": false, "md5_digest": "fd0f3de050e51d615682a00d0ddce857", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 308918, "upload_time": "2018-10-23T16:18:23", "url": "https://files.pythonhosted.org/packages/f4/92/9f83e21a1f43844474ef20e945df639c859439a074026a458563d89e3a55/queryparser-python2-0.4.2.tar.gz" } ] }