{ "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": "", "maintainer_email": "", "name": "queryparser-python3", "package_url": "https://pypi.org/project/queryparser-python3/", "platform": "", "project_url": "https://pypi.org/project/queryparser-python3/", "project_urls": { "Homepage": "https://github.com/aipescience/queryparser" }, "release_url": "https://pypi.org/project/queryparser-python3/0.4.2/", "requires_dist": null, "requires_python": "", "summary": "Parses MySQL and translates ADQL to MySQL.", "version": "0.4.2" }, "last_serial": 4407058, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "ac6a28ba4ac52730ffeab1881bd3d9b3", "sha256": "32afca061857f0d950b39a9b71756da9aaed313773430c7d1e7f39ca8291f67c" }, "downloads": -1, "filename": "queryparser-python3-0.1.tar.gz", "has_sig": false, "md5_digest": "ac6a28ba4ac52730ffeab1881bd3d9b3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 217075, "upload_time": "2017-08-11T10:59:03", "url": "https://files.pythonhosted.org/packages/34/94/7363e35e0743556a209f254765bf33e2ec295c3b04ca54375c26380edbc6/queryparser-python3-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "b75a1bc0ea2e5143629ba217afe4051c", "sha256": "2896fda9577ef5009ad95ded2a623579c9059501aeb8be8d08cf3482e2348783" }, "downloads": -1, "filename": "queryparser-python3-0.1.1.tar.gz", "has_sig": false, "md5_digest": "b75a1bc0ea2e5143629ba217afe4051c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 211736, "upload_time": "2017-08-15T14:19:27", "url": "https://files.pythonhosted.org/packages/cd/78/0046b679aff39940c21c0a83e59a20554922388c8b3a694744f0225a28fd/queryparser-python3-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "e4e7666102be26b4ea3f7d574eaa0f03", "sha256": "8f2585cccb40ca308e2d2fa9de400519de831e0dee960f175bee6ec513384d69" }, "downloads": -1, "filename": "queryparser-python3-0.1.2.tar.gz", "has_sig": false, "md5_digest": "e4e7666102be26b4ea3f7d574eaa0f03", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 209651, "upload_time": "2017-08-18T15:01:35", "url": "https://files.pythonhosted.org/packages/0f/65/e5026f8b591af413091b7e9076468db3a156b3809826e556385f71e271c0/queryparser-python3-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "529141b5daafc7d3cd4cf9a1e7b5aca3", "sha256": "7a884b98c8cd8dea51fb93d9f0c8d09dc32ffc2e8a0cb497f2897ffa13573e3a" }, "downloads": -1, "filename": "queryparser-python3-0.1.3.tar.gz", "has_sig": false, "md5_digest": "529141b5daafc7d3cd4cf9a1e7b5aca3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 211615, "upload_time": "2017-08-24T09:29:58", "url": "https://files.pythonhosted.org/packages/15/94/1c8ce90a4d9943d30e4d58b52c2ded6c3168aa7b0880ba1df90b2f16a0b6/queryparser-python3-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "a52ed5d89c1c7bd7cf176197b98a3d95", "sha256": "a2a41d31d73a40827690755b02d587da497e882a21da2425651232fddcfa2fe3" }, "downloads": -1, "filename": "queryparser-python3-0.1.4.tar.gz", "has_sig": false, "md5_digest": "a52ed5d89c1c7bd7cf176197b98a3d95", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 211595, "upload_time": "2017-08-24T09:37:25", "url": "https://files.pythonhosted.org/packages/a2/bd/d8a18deea4f35d48bfd5914b6c27ef3c344c3afe7b107bdc196fd16b91a5/queryparser-python3-0.1.4.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "658bebcb8bd8992e7d4524bc09ec773b", "sha256": "d760e52a7e3b06c91693a0be9b2f1c4044684f77f9c49233c5455dd7048d7588" }, "downloads": -1, "filename": "queryparser-python3-0.2.0.tar.gz", "has_sig": false, "md5_digest": "658bebcb8bd8992e7d4524bc09ec773b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 213548, "upload_time": "2017-08-31T11:24:27", "url": "https://files.pythonhosted.org/packages/bc/34/c69aecadc69d7da69ab53ebd87c0910473df36f07a7357b8dc74db5d0c2e/queryparser-python3-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "ad725ea26920b6c430e7c50edcb1d468", "sha256": "f5be7dea8dbc48ad1bbdc36178b3ecdb18eadbd3324864d6ebefe3e051e780be" }, "downloads": -1, "filename": "queryparser-python3-0.2.1.tar.gz", "has_sig": false, "md5_digest": "ad725ea26920b6c430e7c50edcb1d468", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 214839, "upload_time": "2017-09-05T12:09:28", "url": "https://files.pythonhosted.org/packages/da/b5/169d2ebcde23ac759313698ed0664918b0974ccaba4bb77cdb358ad02156/queryparser-python3-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "2db8150a150844014b9a4a0e3b4c46d9", "sha256": "53a72871eb0c8e50bb9bfd2ffc292888c5c2c274c2b5f5bcafe3fa38b571b8a1" }, "downloads": -1, "filename": "queryparser-python3-0.2.2.tar.gz", "has_sig": false, "md5_digest": "2db8150a150844014b9a4a0e3b4c46d9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 216518, "upload_time": "2017-09-12T13:55:40", "url": "https://files.pythonhosted.org/packages/e5/e0/b5d38945d91d0554f95efdc95d7abdd8496c95ca59d77891c02d4fda4beb/queryparser-python3-0.2.2.tar.gz" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "ea51c5467e4672443ecd212066b48c3b", "sha256": "53b0e89ceb3476990e87b005dd306438c3c636534ef291c427cbc87896494c99" }, "downloads": -1, "filename": "queryparser-python3-0.2.3.tar.gz", "has_sig": false, "md5_digest": "ea51c5467e4672443ecd212066b48c3b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 216803, "upload_time": "2017-09-18T13:42:44", "url": "https://files.pythonhosted.org/packages/28/e3/61f1b80bd80de9c14eebc72bdbbb40a843e4f67c2eacba1269b7923732b3/queryparser-python3-0.2.3.tar.gz" } ], "0.2.4": [ { "comment_text": "", "digests": { "md5": "d16937a570894ccc6e058e495ba9d5dd", "sha256": "cd8058555f4fd42c27e9fe1b671b464790ed5088ec52db41c5afb49953b8d822" }, "downloads": -1, "filename": "queryparser-python3-0.2.4.tar.gz", "has_sig": false, "md5_digest": "d16937a570894ccc6e058e495ba9d5dd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 217788, "upload_time": "2017-09-25T08:51:37", "url": "https://files.pythonhosted.org/packages/a1/89/672ed606cfaab01a0e32b7737268d580def320955c0df8d443c4e2431c1b/queryparser-python3-0.2.4.tar.gz" } ], "0.2.5": [ { "comment_text": "", "digests": { "md5": "c636cd25d85d4726ba413a8b4c4a26fb", "sha256": "7933cded437186157c38b178395fe0b9dd9bfb2d3d0cf968f84358d446a72008" }, "downloads": -1, "filename": "queryparser-python3-0.2.5.tar.gz", "has_sig": false, "md5_digest": "c636cd25d85d4726ba413a8b4c4a26fb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 304996, "upload_time": "2018-02-17T08:39:55", "url": "https://files.pythonhosted.org/packages/ac/ca/6dcc39fde10c293db89fbb230340d786b6210e8a4b3f1abde1b5bad88a82/queryparser-python3-0.2.5.tar.gz" } ], "0.2.6": [ { "comment_text": "", "digests": { "md5": "88049f8e6a21d23e52f1d36b437c0418", "sha256": "e8da0393f66c1f56c1080ae848b1bd3caae1e806e66d88d70a0fa9a3a221159c" }, "downloads": -1, "filename": "queryparser-python3-0.2.6.tar.gz", "has_sig": false, "md5_digest": "88049f8e6a21d23e52f1d36b437c0418", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 302448, "upload_time": "2018-02-23T14:32:29", "url": "https://files.pythonhosted.org/packages/ce/83/9910f88f96855c176819997d5411f03730777bdbcddd073f8110bd580b44/queryparser-python3-0.2.6.tar.gz" } ], "0.2.7": [ { "comment_text": "", "digests": { "md5": "b5935a8c7256ede95c11ba6e717a1b4f", "sha256": "681127efaffeb4f69055fd0f0543020e986e49179f5460c1d269055db6dcfcc5" }, "downloads": -1, "filename": "queryparser-python3-0.2.7.tar.gz", "has_sig": false, "md5_digest": "b5935a8c7256ede95c11ba6e717a1b4f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 302880, "upload_time": "2018-04-05T11:00:15", "url": "https://files.pythonhosted.org/packages/0b/51/2555de92aa7ed0ef0e8c3762bd615dad55440108489ba63b85e98849cb35/queryparser-python3-0.2.7.tar.gz" } ], "0.2.8": [ { "comment_text": "", "digests": { "md5": "03dfbeda0718ff90a6a5b3a8f31a8fe2", "sha256": "2809c8ad6f217ceb4e28e6b1454fd45eaa20edd35e78a4120026aff18b7aaa13" }, "downloads": -1, "filename": "queryparser-python3-0.2.8.tar.gz", "has_sig": false, "md5_digest": "03dfbeda0718ff90a6a5b3a8f31a8fe2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 303657, "upload_time": "2018-04-18T15:57:08", "url": "https://files.pythonhosted.org/packages/90/1d/2109de6a07ff656476b705a503ba45c87763e386d87a9fdb313952bbd501/queryparser-python3-0.2.8.tar.gz" } ], "0.2.9": [ { "comment_text": "", "digests": { "md5": "c6fc344e9d6cbacd84da551ae5671910", "sha256": "07e1589bdd1bf8a4836a50512f2e006cea6d02bb10e15bff067abe0a7bff3cb6" }, "downloads": -1, "filename": "queryparser-python3-0.2.9.tar.gz", "has_sig": false, "md5_digest": "c6fc344e9d6cbacd84da551ae5671910", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 303874, "upload_time": "2018-04-21T13:26:11", "url": "https://files.pythonhosted.org/packages/57/f0/97aaa895fea214cdf5859dce997115f063a66b8c05a89bbb315b0a1f04b2/queryparser-python3-0.2.9.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "c40e0089ea7b7941467b783e7d13b59b", "sha256": "aa542cfea027c7e4ec2704b099fa6a133945cfe7b60aed6a92e1ef0e79cba3f4" }, "downloads": -1, "filename": "queryparser-python3-0.3.tar.gz", "has_sig": false, "md5_digest": "c40e0089ea7b7941467b783e7d13b59b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 305109, "upload_time": "2018-04-25T08:06:36", "url": "https://files.pythonhosted.org/packages/e4/94/e9cfef50707a3e3f57f8848619a9a2863ba66563e7dc99be862283ff0344/queryparser-python3-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "fe30d87f2ba19080db5d80d59126fd3a", "sha256": "97a0f95160dc9d6ad2f3e15f6f1ef30b4c0cf0485d7d074671e201020b9c8665" }, "downloads": -1, "filename": "queryparser-python3-0.4.tar.gz", "has_sig": false, "md5_digest": "fe30d87f2ba19080db5d80d59126fd3a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 305832, "upload_time": "2018-10-12T08:55:18", "url": "https://files.pythonhosted.org/packages/f7/bf/90be500ca32ef908187e2364ea3cc21cdcbd75df728d9a6b764fd2e39364/queryparser-python3-0.4.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "ab62998e710dfc38fdc120ef6b1b8c4b", "sha256": "4eae5022b08e5f31f8653cd40edae537e932ee9d2715a3da99b615ede3db1afa" }, "downloads": -1, "filename": "queryparser-python3-0.4.1.tar.gz", "has_sig": false, "md5_digest": "ab62998e710dfc38fdc120ef6b1b8c4b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 305856, "upload_time": "2018-10-12T11:28:53", "url": "https://files.pythonhosted.org/packages/0b/e6/d844c684403c84fda7aa315585ad2162c0386d025d3e104c5c1cac6b6a20/queryparser-python3-0.4.1.tar.gz" } ], "0.4.2": [ { "comment_text": "", "digests": { "md5": "001dfb194c332ccdf3b3fe61b61e9ebd", "sha256": "7c9c57a948424f1c272a980d66ddf86e4599bb0904ff881a2f31472c09f36ce1" }, "downloads": -1, "filename": "queryparser-python3-0.4.2.tar.gz", "has_sig": false, "md5_digest": "001dfb194c332ccdf3b3fe61b61e9ebd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 305880, "upload_time": "2018-10-23T16:18:26", "url": "https://files.pythonhosted.org/packages/b3/69/bc654233bbd070844603d5115663f913cdc72e922dec360cdac75452b2b0/queryparser-python3-0.4.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "001dfb194c332ccdf3b3fe61b61e9ebd", "sha256": "7c9c57a948424f1c272a980d66ddf86e4599bb0904ff881a2f31472c09f36ce1" }, "downloads": -1, "filename": "queryparser-python3-0.4.2.tar.gz", "has_sig": false, "md5_digest": "001dfb194c332ccdf3b3fe61b61e9ebd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 305880, "upload_time": "2018-10-23T16:18:26", "url": "https://files.pythonhosted.org/packages/b3/69/bc654233bbd070844603d5115663f913cdc72e922dec360cdac75452b2b0/queryparser-python3-0.4.2.tar.gz" } ] }