A non-validating SQL parser module for Python
Python PLpgSQL Makefile
Clone or download
slickholms and andialbrecht Added HAVING class
added a class named Having and inherited it with TokenList
It will be easier for further manipulations as a HAVING clause contains multiple conditions just like WHERE clause
Latest commit 8bf78a0 Jun 25, 2018

README.rst

python-sqlparse - Parse SQL statements

sqlparse is a non-validating SQL parser module for Python.

buildstatus coverage

Install

From pip, run:

$ pip install --upgrade sqlparse

Consider using the --user option.

From the repository, run:

python setup.py install

to install python-sqlparse on your system.

python-sqlparse is compatible with Python 2.7 and Python 3 (>= 3.3).

Run Tests

To run the test suite run:

tox

Note, you'll need tox installed, of course.

Links

Project Page
https://github.com/andialbrecht/sqlparse
Documentation
https://sqlparse.readthedocs.io/en/latest/
Discussions
https://groups.google.com/forum/#!forum/sqlparse
Issues/Bugs
https://github.com/andialbrecht/sqlparse/issues
Online Demo
https://sqlformat.org/

python-sqlparse is licensed under the BSD license.

Parts of the code are based on pygments written by Georg Brandl and others. pygments-Homepage: http://pygments.org/