Skip to main content

psycopg2 - Python-PostgreSQL Database Adapter

Project description

Psycopg is the most popular PostgreSQL database adapter for the Python programming language. Its main features are the complete implementation of the Python DB API 2.0 specification and the thread safety (several threads can share the same connection). It was designed for heavily multi-threaded applications that create and destroy lots of cursors and make a large number of concurrent “INSERT”s or “UPDATE”s.

Psycopg 2 is mostly implemented in C as a libpq wrapper, resulting in being both efficient and secure. It features client-side and server-side cursors, asynchronous communication and notifications, “COPY TO/COPY FROM” support. Many Python types are supported out-of-the-box and adapted to matching PostgreSQL data types; adaptation can be extended and customized thanks to a flexible objects adaptation system.

Psycopg 2 is both Unicode and Python 3 friendly.

Documentation

Documentation is included in the doc directory and is available online.

For any other resource (source code repository, bug tracker, mailing list) please check the project homepage.

Installation

Building Psycopg requires a few prerequisites (a C compiler, some development packages): please check the install and the faq documents in the doc dir or online for the details.

If prerequisites are met, you can install psycopg like any other Python package, using pip to download it from PyPI:

$ pip install psycopg2

or using setup.py if you have downloaded the source package locally:

$ python setup.py build
$ sudo python setup.py install

You can also obtain a stand-alone package, not requiring a compiler or external libraries, by installing the psycopg2-binary package from PyPI:

$ pip install psycopg2-binary

The binary package is a practical choice for development and testing but in production it is advised to use the package built from sources.

Linux/OSX:Linux and OSX build status
Windows:Windows build status

Release history Release notifications

This version
History Node

2.7.4

History Node

2.7.3.2

History Node

2.7.3.1

History Node

2.7.3

History Node

2.7.2

History Node

2.7.1

History Node

2.7

History Node

2.6.2

History Node

2.6.1

History Node

2.6

History Node

2.5.5

History Node

2.5.4

History Node

2.5.3

History Node

2.5.2

History Node

2.5.1

History Node

2.5

History Node

2.4.6

History Node

2.4.5

History Node

2.4.4

History Node

2.4.3

History Node

2.4.2

History Node

2.4.1

History Node

2.4

History Node

2.3.2

History Node

2.3.1

History Node

2.3.0

History Node

2.2.2

History Node

2.2.1

History Node

2.2.0

History Node

2.0.14

History Node

2.0.13

History Node

2.0.12

History Node

2.0.11

History Node

2.0.10

History Node

2.0.8

History Node

2.0.7

History Node

2.0.6

History Node

2.0.5.1

History Node

2.0.4

History Node

2.0.3

History Node

2.0.2

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
psycopg2-2.7.4-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (1.7 MB) Copy SHA256 hash SHA256 Wheel cp27 Feb 8, 2018
psycopg2-2.7.4-cp27-cp27m-manylinux1_i686.whl (2.4 MB) Copy SHA256 hash SHA256 Wheel cp27 Feb 8, 2018
psycopg2-2.7.4-cp27-cp27m-manylinux1_x86_64.whl (2.7 MB) Copy SHA256 hash SHA256 Wheel cp27 Feb 8, 2018
psycopg2-2.7.4-cp27-cp27mu-manylinux1_i686.whl (2.4 MB) Copy SHA256 hash SHA256 Wheel cp27 Feb 8, 2018
psycopg2-2.7.4-cp27-cp27mu-manylinux1_x86_64.whl (2.7 MB) Copy SHA256 hash SHA256 Wheel cp27 Feb 8, 2018
psycopg2-2.7.4-cp27-cp27m-win32.whl (859.6 kB) Copy SHA256 hash SHA256 Wheel cp27 Feb 8, 2018
psycopg2-2.7.4-cp27-cp27m-win_amd64.whl (990.5 kB) Copy SHA256 hash SHA256 Wheel cp27 Feb 8, 2018
psycopg2-2.7.4-cp33-cp33m-manylinux1_i686.whl (2.4 MB) Copy SHA256 hash SHA256 Wheel cp33 Feb 8, 2018
psycopg2-2.7.4-cp33-cp33m-manylinux1_x86_64.whl (2.7 MB) Copy SHA256 hash SHA256 Wheel cp33 Feb 8, 2018
psycopg2-2.7.4-cp33-cp33m-win32.whl (866.3 kB) Copy SHA256 hash SHA256 Wheel cp33 Feb 8, 2018
psycopg2-2.7.4-cp33-cp33m-win_amd64.whl (988.3 kB) Copy SHA256 hash SHA256 Wheel cp33 Feb 8, 2018
psycopg2-2.7.4-cp34-cp34m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (1.7 MB) Copy SHA256 hash SHA256 Wheel cp34 Feb 8, 2018
psycopg2-2.7.4-cp34-cp34m-manylinux1_i686.whl (2.4 MB) Copy SHA256 hash SHA256 Wheel cp34 Feb 8, 2018
psycopg2-2.7.4-cp34-cp34m-manylinux1_x86_64.whl (2.7 MB) Copy SHA256 hash SHA256 Wheel cp34 Feb 8, 2018
psycopg2-2.7.4-cp34-cp34m-win32.whl (866.2 kB) Copy SHA256 hash SHA256 Wheel cp34 Feb 8, 2018
psycopg2-2.7.4-cp34-cp34m-win_amd64.whl (988.1 kB) Copy SHA256 hash SHA256 Wheel cp34 Feb 8, 2018
psycopg2-2.7.4-cp35-cp35m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (1.7 MB) Copy SHA256 hash SHA256 Wheel cp35 Feb 8, 2018
psycopg2-2.7.4-cp35-cp35m-manylinux1_i686.whl (2.4 MB) Copy SHA256 hash SHA256 Wheel cp35 Feb 8, 2018
psycopg2-2.7.4-cp35-cp35m-manylinux1_x86_64.whl (2.7 MB) Copy SHA256 hash SHA256 Wheel cp35 Feb 8, 2018
psycopg2-2.7.4-cp35-cp35m-win32.whl (853.7 kB) Copy SHA256 hash SHA256 Wheel cp35 Feb 8, 2018
psycopg2-2.7.4-cp35-cp35m-win_amd64.whl (996.5 kB) Copy SHA256 hash SHA256 Wheel cp35 Feb 8, 2018
psycopg2-2.7.4-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (1.7 MB) Copy SHA256 hash SHA256 Wheel cp36 Feb 8, 2018
psycopg2-2.7.4-cp36-cp36m-manylinux1_i686.whl (2.4 MB) Copy SHA256 hash SHA256 Wheel cp36 Feb 8, 2018
psycopg2-2.7.4-cp36-cp36m-manylinux1_x86_64.whl (2.7 MB) Copy SHA256 hash SHA256 Wheel cp36 Feb 8, 2018
psycopg2-2.7.4-cp36-cp36m-win32.whl (853.7 kB) Copy SHA256 hash SHA256 Wheel cp36 Feb 8, 2018
psycopg2-2.7.4-cp36-cp36m-win_amd64.whl (996.4 kB) Copy SHA256 hash SHA256 Wheel cp36 Feb 8, 2018
psycopg2-2.7.4.tar.gz (425.3 kB) Copy SHA256 hash SHA256 Source None Feb 8, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page