Skip to main content

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.

Build status:

Build status

Download files

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

Source Distribution

psycopg2-2.9.13.tar.gz (378.1 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

psycopg2-2.9.13-cp315-cp315-win_amd64.whl (2.9 MB view details)

Uploaded CPython 3.15Windows x86-64

psycopg2-2.9.13-cp314-cp314-win_amd64.whl (2.9 MB view details)

Uploaded CPython 3.14Windows x86-64

psycopg2-2.9.13-cp313-cp313-win_amd64.whl (2.8 MB view details)

Uploaded CPython 3.13Windows x86-64

psycopg2-2.9.13-cp312-cp312-win_amd64.whl (2.8 MB view details)

Uploaded CPython 3.12Windows x86-64

psycopg2-2.9.13-cp311-cp311-win_amd64.whl (2.8 MB view details)

Uploaded CPython 3.11Windows x86-64

psycopg2-2.9.13-cp310-cp310-win_amd64.whl (2.8 MB view details)

Uploaded CPython 3.10Windows x86-64

File details

Details for the file psycopg2-2.9.13.tar.gz.

File metadata

  • Download URL: psycopg2-2.9.13.tar.gz
  • Upload date:
  • Size: 378.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.12

File hashes

Hashes for psycopg2-2.9.13.tar.gz
Algorithm Hash digest
SHA256 d36784fc2dae69523ba4b79c7d1d1b4d6e83e87836874f111262f4db940b16a6
MD5 aea3199952c6dea47c1e2fee7341554a
BLAKE2b-256 91816ea19b8b28feb9405c8c87a307776614d6e404bdb98467d1ce10a39d2c1d

See more details on using hashes here.

File details

Details for the file psycopg2-2.9.13-cp315-cp315-win_amd64.whl.

File metadata

  • Download URL: psycopg2-2.9.13-cp315-cp315-win_amd64.whl
  • Upload date:
  • Size: 2.9 MB
  • Tags: CPython 3.15, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.12

File hashes

Hashes for psycopg2-2.9.13-cp315-cp315-win_amd64.whl
Algorithm Hash digest
SHA256 0d2fc7eedfaca0586dcf1476454598428d0d8471d3b5cb55f92015a5f9d0af40
MD5 b4900f741168fd93eb9ea37b2af4d0bd
BLAKE2b-256 440fda6a374ed5e3b4040c53b29ab57b8b26c0872900cf8aed2265790889a1e3

See more details on using hashes here.

File details

Details for the file psycopg2-2.9.13-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: psycopg2-2.9.13-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 2.9 MB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.12

File hashes

Hashes for psycopg2-2.9.13-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 a6f54fd8e0024f35240866b5dfff9ead2a0dbd33b8096eec438bc6093412842d
MD5 8f3be97dff6cedd2690ad330aaec76d6
BLAKE2b-256 b9f9f6e9d47ea04e09282c618f5eeb67634f39ea4b04acedd0a6d8da4d986d50

See more details on using hashes here.

File details

Details for the file psycopg2-2.9.13-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: psycopg2-2.9.13-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 2.8 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.12

File hashes

Hashes for psycopg2-2.9.13-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 165e25c1b0e616a1f28080c5c68bd2dc015051d83c90240b2171d3e76ca2b5ff
MD5 738cab9d8a5aa07c0368ee2bea352c0a
BLAKE2b-256 e1a5a01216e7c2e477052469c0317a4e71e031293830c9882ca372bae167bec3

See more details on using hashes here.

File details

Details for the file psycopg2-2.9.13-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: psycopg2-2.9.13-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 2.8 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.12

File hashes

Hashes for psycopg2-2.9.13-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 10f7408b34412e8c0d4f8b1565541f1d651b1d00447857e5d8561b38f5c1a738
MD5 49fb5e9ffd3a3d5a5966cae84e516ba1
BLAKE2b-256 4e8a820b2f5ec521db28b5f113d7d64b0264f775fef611265039ba0cb5101858

See more details on using hashes here.

File details

Details for the file psycopg2-2.9.13-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: psycopg2-2.9.13-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 2.8 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.12

File hashes

Hashes for psycopg2-2.9.13-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 d16e7a5f5e400ac51ca953d42255804eff6c8a9650b1a2074f6ca6261d740382
MD5 223e2de0b11214f62b21489d2cea9036
BLAKE2b-256 795131d303c9aec410b853861077acc7a9b1f0a5b43f003061f748ab486735f5

See more details on using hashes here.

File details

Details for the file psycopg2-2.9.13-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: psycopg2-2.9.13-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 2.8 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.12

File hashes

Hashes for psycopg2-2.9.13-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 7d48416f6a4823ada9b33771085331b842b553df88435701bff5ddb4469905de
MD5 74f3adc47b6d100846c1995ea19fa9fc
BLAKE2b-256 4db9c29fb26fd2a98a5a65674f638e6ad989bc8742e62947ebde2cff88cf3988

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

2.9.13 This release

7 files

2.9.12

7 files

2.9.11

7 files

2.9.10

10 files

2.9.9

13 files

2.9.8

11 files

2.9.7

11 files

2.9.6

13 files

2.9.5

13 files

2.9.4

11 files

2.9.3

11 files

2.9.2

11 files

2.9.1

11 files

2.9

9 files

2.8.6

15 files

2.8.5

13 files

2.8.4

13 files

2.8.3

11 files

2.8.2

11 files

2.8.1

11 files

2.8

11 files

2.7.7

30 files

2.7.6.1

30 files

2.7.6

30 files

2.7.5

30 files

2.7.4

27 files

2.7.3.2

31 files

2.7.3.1

31 files

2.7.3

31 files

2.7.2

31 files

2.7.1

31 files

2.7

31 files

2.6.2

15 files

2.6.1

11 files

2.6

1 file

2.5.5

1 file

2.5.4

1 file

2.5.3

1 file

2.5.2

1 file

2.5.1

1 file

2.5

1 file

2.4.6

1 file

2.4.5

1 file

2.4.4

1 file

2.4.3

1 file

2.4.2

1 file

2.4.1

1 file

2.4

1 file

2.3.2

1 file

2.3.1

1 file

2.3.0

1 file

2.2.2

1 file

2.2.1

1 file

2.2.0

1 file

2.0.14

1 file

2.0.13

1 file

2.0.12

1 file

2.0.11

1 file

2.0.10

1 file

2.0.8

2.0.7

2.0.6

2.0.5.1

2.0.4

2.0.3

2.0.2

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page