This is txpostgres is a library for accessing a PostgreSQL_ database from the Twisted_ framework. It builds upon asynchronous features of the Psycopg_ database library, which in turn exposes the asynchronous features of libpq_, the PostgreSQL C library. It requires a version of Psycopg that includes support for `asynchronous connections`_ (versions 2.2.0 and later) and a reasonably recent Twisted (it has been tested with Twisted 10.2 onward). Alternatively, psycopg2-ctypes_ can be used in lieu of Psycopg. txpostgres tries to present an interface that will be familiar to users of both Twisted and Psycopg. It features a Cursor_ wrapper class that mimics the interface of a `Psycopg cursor`_ but returns Deferred_ objects. It also provides a Connection_ class that is meant to be a drop-in replacement for Twisted's `adbapi.Connection`_ with some small differences regarding connection establishing. The main advantage of txpostgres over Twisted's built-in database support is non-blocking connection building and complete lack of thread usage. It runs on Python 2.5, 2.6, 2.7 and PyPy_. If you got txpostgres as a source tarball, you can run the automated test suite and install the library with:: tar xjf txpostgres-x.x.x.tar.bz2 cd txpostgres-x.x.x trial test sudo python install Alternatively, just install it from PyPI_:: pip install txpostgres The library is distributed under the MIT License, see the LICENSE file for details. You can contact the author, Jan Urbański, at Feel free to download the source_, file bugs in the `issue tracker`_ and consult the documentation_ .. _PostgreSQL: .. _Twisted: .. _Psycopg: .. _Python: .. _libpq: .. _`asynchronous connections`: .. _psycopg2-ctypes: .. _Cursor: .. _Psycopg cursor: .. _Deferred: .. _Connection: .. _adbapi.Connection: .. _PyPy: .. _PyPI: .. _source: .. _issue tracker: .. _documentation: .. image::


Project Slug


Last Built

8 years, 2 months ago passed


Home Page



postgres, postgresql, psycopg2, twisted

Short URLs

Default Version


'latest' Version