SQLPython is a command-line interface to relational databases. It was created as an alternative to Oracle’s SQL\*Plus, and can likewise be used instead of postgres’ psql or mysql’s mysql text clients. For the most part, it can be used as any other text-based SQL interface would; this document focuses on the extra capabilities.


sqlpython is free and open-source software. Its use is governed by the MIT License.


SQLPython was created by Luca Canali at CERN. Most recent development has been done by Catherine Devlin. A group of additional sqlpython contributors has formed at Google Groups.


If python-setuptools is present on your machine, you can easily install the latest release of sqlpython by issuing from a command prompt:

easy_install sqlpython

The development trunk (very unstable) is at assembla; you can install the trunk on your machine with:

hg clone cmd2
      cd cmd2
      python develop

      cd ..
      hg clone sqlpython
      cd sqlpython
      python develop

Using hg pull, hg update subsequently will update from the current trunk.

You may also install from the trunk with easy_install:



sqlpython [username[/password][@SID]] [“SQL command 1”, “@script.sql”, “SQL command 2...”]


sqlpython [–postgres|mysql] database-name username

Database connections can also be specified with URL syntax or with Oracle Easy Connect:




SID represents an entry from the tnsnames.ora file.

Once connected, most familiar SQL*Plus commands can be used. Type help for additional information.


SQLPython is based on the Python standard library’s cmd module, and on an extension to it called cmd2. SQLPython also draws considerable inspiration from two Perl-based open-source SQL clients, Senora and YASQL.

Non-Oracle RDBMS

Version 1.7.2 of sqlpython works against PostgreSQL and MySQL, though the testing against those databases has been very slight thus far. Help in testing and improving sqlpython’s functions against those databases is welcome. Support for Microsoft SQL Server and sqlite will be available as soon as those databases are added to the Gerald project, and volunteers for Gerald will benefit sqlpython as well.

Table Of Contents

Previous topic

Welcome to SQLPython’s documentation!

Next topic

SQLPython’s extra capabilities

This Page