### Navigation

- index
- modules |
- next |
- python-sqlparse 0.1.10 documentation »

# python-sqlparse

`sqlparse` is a non-validating SQL parser for Python. It provides support for parsing, splitting and formatting SQL statements.

The module is compatible with Python 2 (>= 2.5) and Python 3 (>= 3.2) and released under the terms of the New BSD license.

Visit the project page at https://github.com/andialbrecht/sqlparse for further information about this project.

## tl;dr

    $ pip install sqlparse
    $ python
    >>> import sqlparse
    >>> print(sqlparse.format('select * from foo', reindent=True))
    select *
    from foo
    >>> parsed = sqlparse.parse('select * from foo')[0]
    >>> parsed.tokens
    [<DML 'select' at 0x7f22c5e15368>, <Whitespace ' ' at 0x7f22c5e153b0>, <Wildcard '*' … ]
    >>>

## Contents

- Introduction
  - Download & Installation
  - Getting Started
  - Development & Contributing
- `sqlparse` – Parse SQL statements
  - Formatting of SQL Statements
- Analyzing the Parsed Statement
  - Base Classes
  - SQL Representing Classes
- User Interfaces
- Changes in python-sqlparse
  - Upcoming Deprecations
  - Release 0.1.10 (Nov 02, 2013)
  - Release 0.1.9 (Sep 28, 2013)
  - Release 0.1.8 (Jun 29, 2013)
  - Release 0.1.7 (Apr 06, 2013)
  - Release 0.1.6 (Jan 01, 2013)
  - Release 0.1.5 (Nov 13, 2012)
  - Release 0.1.4 (Apr 20, 2012)
  - Release 0.1.3 (Jul 29, 2011)
  - Release 0.1.2 (Nov 23, 2010)
  - Release 0.1.1 (May 6, 2009)
  - Release 0.1.0 (Apr 8, 2009)
- Indices and tables

## Resources

Project page
  https://github.com/andialbrecht/sqlparse
Bug tracker
  https://github.com/andialbrecht/sqlparse/issues
Documentation
  http://sqlparse.readthedocs.org/

### Navigation

- index
- modules |
- next |
- python-sqlparse 0.1.10 documentation »