Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Twisted wrapper for asynchronous PostgreSQL connections
Python
branch: master
Failed to load latest commit information.
doc Clean up all flake8 errors. No code changes.
test Do not close internally used cursors at all.
txpostgres
.gitignore Add files generated by coverage to gitignore.
.travis.yml Disable testing using select reactor on Travis.
LICENSE Update copyright notices for 2012 (and 2011 for that matter).
MANIFEST.in Initial commit
NEWS Do not close internally used cursors at all.
NOTICE Add seemingly required license mumbo-jumbo.
README.rst Mention psycopg2cffi in the README as well.
requirements.txt Move the requirements file to the root of the project.
setup.cfg Initial commit
setup.py Clean up all flake8 errors. No code changes.

README.rst

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, psycopg2cffi or 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 setup.py 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 wulczer@wulczer.org. Feel free to download the source, file bugs in the issue tracker and consult the documentation

https://secure.travis-ci.org/wulczer/txpostgres.png?branch=master
Something went wrong with that request. Please try again.