sqlparse is a non-validating SQL parser module. It provides support for parsing, splitting and formatting SQL statements. WWW: http://code.google.com/p/python-sqlparse/