psycopg is a PostgreSQL database adapter for the Python programming language. Its main advantages are that it supports the full Python DBAPI 2.0 and it is thread safe at level 2.
psycopg was designed for heavily multi-threaded applications that create and destroy lots of cursors and make a conspicuous number of concurrent INSERTs or UPDATEs.
The psycopg distribution includes ZPsycopgDA, a Zope Database Adapter. This page is about psycopg 2, an almost complete rewrite of the psycopg 1.1.x branch.
Psycopg 2 features complete libpq v3 protocol COPY TO/COPY FROM and full object adaptation for all basic Python 2.3 types: strings (including unicode), ints, longs, floats, buffers (binary objects), booleans, mx.DateTime and builtin datetime types.
It also supports unicode queries and Python lists mapped to PostgreSQL arrays.
What's New in This Release: [ read full changelog ]
· This release features a bytea parser to make sure psycopg will work with binary data independently from libpq and PostgreSQL versions; support for non-normalized character encodings; a fix for empty queries; and better error reporting.