Psycopg

From PostgreSQL wiki
(Redirected from Psycopg2)
Jump to navigationJump to search

Psycopg is a PostgreSQL database adapter for the Python programming language. It conforms to DB-API 2.0 standard.

It is currently at version 2.x, which is a complete rewrite of the original 1.x code to provide new-style classes for connection and cursor objects and other sweet candies. Like the psycopg1, psycopg2 was written with the aim of being very small and fast, and stable as a rock.

Psycopg is designed for heavily multi-threaded applications that create and destroy lots of cursors and make a conspicuous number of concurrent INSERTs or UPDATEs.

Version 2.2 introduces async support and is compatible with coroutine libraries, allowing its use with nonblocking I/O libraries such as Eventlet, gevent, uGreen.

Installation

From version 2.7 psycopg is distributed as binary package on PyPI:

$ pip install -U pip      # make sure your pip is up-to-date
$ pip install psycopg2

Links

Mailing Lists

Getting GIT repo

git clone https://github.com/psycopg/psycopg2.git