skillfed

psycopg2-binary

psycopg2 - Python-PostgreSQL Database Adapter

psycopg2-binary Copyleft license LGPL with exceptions Active 3,652 v2.9.12 released

Install

psycopg2-binary on PyPI

pip

pip install psycopg2-binary

uv

uv add psycopg2-binary

poetry

poetry add psycopg2-binary

Package facts

License LGPL with exceptions (copyleft)
Python support supports the current Python release (>=3.9)
Install friction medium — platform-specific wheel
Runtime dependencies none
Maintenance actively maintained — 115 days since the last release
Last repo commit
First released
Popularity one of the top 1,000 most-downloaded packages on PyPI (30-day window, as of 2026-08-13)
Known vulnerabilities none known (OSV.dev, checked 2026-08-13)

Evidence: psycopg2_binary-2.9.12-cp310-cp310-macosx_10_9_x86_64.whl; psycopg2_binary-2.9.12-cp310-cp310-macosx_11_0_arm64.whl; psycopg2_binary-2.9.12-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl; psycopg2_binary-2.9.12-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; psycopg2_binary-2.9.12-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl; psycopg2_binary-2.9.12-cp310-cp310-manylinux_2_38_riscv64.manylinux_2_39_riscv64.whl; psycopg2_binary-2.9.12-cp310-cp310-musllinux_1_2_aarch64.whl; psycopg2_binary-2.9.12-cp310-cp310-musllinux_1_2_ppc64le.whl; psycopg2_binary-2.9.12-cp310-cp310-musllinux_1_2_riscv64.whl; psycopg2_binary-2.9.12-cp310-cp310-musllinux_1_2_x86_64.whl; psycopg2_binary-2.9.12-cp310-cp310-win_amd64.whl; psycopg2_binary-2.9.12-cp311-cp311-macosx_10_9_x86_64.whl; psycopg2_binary-2.9.12-cp311-cp311-macosx_11_0_arm64.whl; psycopg2_binary-2.9.12-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl; psycopg2_binary-2.9.12-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; psycopg2_binary-2.9.12-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl; psycopg2_binary-2.9.12-cp311-cp311-manylinux_2_38_riscv64.manylinux_2_39_riscv64.whl; psycopg2_binary-2.9.12-cp311-cp311-musllinux_1_2_aarch64.whl; psycopg2_binary-2.9.12-cp311-cp311-musllinux_1_2_ppc64le.whl; psycopg2_binary-2.9.12-cp311-cp311-musllinux_1_2_riscv64.whl

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)Operating System :: Microsoft :: WindowsOperating System :: UnixProgramming Language :: CProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: SQLTopic :: DatabaseTopic :: Database :: Front-EndsTopic :: Software DevelopmentTopic :: Software Development :: Libraries :: Python Modules

About psycopg2-binary

from the package's own PyPI description — quoted content, verbatim

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.

.. Note::

The psycopg2 package is still widely used and actively maintained, but it
is not expected to receive new features.

`Psycopg 3`__ is the evolution of psycopg2 and is where `new features are
being developed`__: if you are starting a new project you should probably
start from 3!

.....

Read as markdown · JSON record · Source repository · Homepage · Docs

AI interpretation — verify before relying

AI-generated interpretation of the package facts above; every digit, version, license, or vulnerability id it cites is grounded in the facts already shown on this page

psycopg2-binary is a PostgreSQL database adapter for Python that implements the DB API 2.0 specification, offering thread-safe connections, client/server-side cursors, and automatic type mapping between Python and PostgreSQL.

Medium install friction due to pre-built wheels for multiple architectures (Python 3.10–3.11, Linux/macOS/Windows). The binary distribution avoids compilation but is noted in the package description as practical for development; production use recommends the source-built variant.

Licensed under LGPL with exceptions (copyleft). Derivative works and modifications must be licensed under compatible terms, though the exception clause may permit some proprietary use—consult the full license text for your specific deployment model.

Usage

pip install psycopg2-binary==2.9.12

import psycopg2
conn = psycopg2.connect("dbname=test user=postgres")
cur = conn.cursor()
cur.execute("SELECT 1")
print(cur.fetchone())

Requires a running PostgreSQL server and valid connection credentials; Python ≥3.9 required.

Verdict: psycopg2-binary is a mature, actively maintained PostgreSQL adapter (last release 115 days ago) with no known vulnerabilities and broad platform support. The binary distribution trades production-grade optimization for zero-compilation convenience; LGPL licensing requires attention to derivative-work obligations. Suitable for development and small-to-medium deployments.

Needs verification

  • Whether the LGPL exception clause permits proprietary use in your deployment context
  • Performance characteristics of the binary distribution versus source-built variant in production
  • Whether Psycopg 3 (mentioned in description) is a better fit for your project's feature needs
postgresql python adapterpostgres database driverpython db api postgresqlpsycopg2 binary installthread-safe postgres connectionpython postgresql client

Similar packages