$npx skillfedfor your agent

psycopg2-binary

psycopg2 - Python-PostgreSQL Database Adapter

Worth itPyPI Software DevelopmentReleased Apr 2026271.6M downloads / moLGPL with exceptionsPlatform wheel

Decision gist · record as of 2026-08-14

platform wheels — 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
v2.9.12 · released 2026-04-20 · Python >=3.9

Yes, for development and testing. psycopg2-binary is the most widely used PostgreSQL adapter for Python and is actively maintained. The binary distribution removes compiler dependencies, making it straightforward to install. For production deployments, consider the source-built psycopg2 package instead. No known security vulnerabilities and LGPL licensing is compatible with most projects.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires a running PostgreSQL server accessible at the connection string provided; psycopg2-binary is a client library and does not include or start a database server.
  • Medium install friction due to binary wheel distribution; pre-compiled wheels available for common platforms (macOS, Linux, Windows) across multiple architectures, avoiding the need for a C compiler and development libraries at install time.
  • Actively maintained with recent releases.

License · maintenance · safety

LGPL with exceptions (copyleft) — Licensed under LGPL with exceptions (copyleft). Derivative works and modifications must be distributed under compatible terms, but linking to psycopg2-binary in a proprietary application is generally permitted under the exception clause.

last release 2026-04-20 (116 days) · last repo commit 2026-05-02 · 3,652 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 271,618,065 downloads/mo, #149 on PyPI

Verify before relying

pip install psycopg2-binary

import psycopg2
conn = psycopg2.connect("dbname=test user=postgres")
cur = conn.cursor()
cur.execute("SELECT * FROM table")
results = cur.fetchall()
  • Whether psycopg2-binary's pre-compiled binaries are suitable for production deployments or if source-built psycopg2 is recommended instead (description notes binary is practical for development/testing).
  • Performance characteristics and any runtime overhead of the binary distribution compared to source-compiled builds.
Same gist for agents: .md · .json

What it is and what it does

psycopg2-binary is a PostgreSQL client library for Python that wraps libpq and implements the Python DB API 2.0 specification. It allows Python applications to open connections to PostgreSQL databases, execute queries, manage transactions, and handle result sets. The package is implemented primarily in C for efficiency and security, and supports both client-side and server-side cursors, asynchronous communication, COPY operations, and automatic type adaptation between Python and PostgreSQL data types.

The binary distribution (psycopg2-binary) ships with pre-compiled wheels for multiple platforms and architectures, eliminating the need for a C compiler or development libraries at install time. This makes it convenient for development and testing environments. However, the description notes that for production use, the source-built psycopg2 package is advised. The package is actively maintained and supports modern Python versions (3.9 through 3.14), though new feature development is focused on Psycopg 3.

Use it for

  • Building web applications that need to query PostgreSQL databases for user data, content, or transactional operations.
  • Creating data pipelines or ETL scripts that read from or write to PostgreSQL tables.
  • Developing multi-threaded applications that require concurrent database access from multiple threads sharing the same connection.
  • Prototyping or testing database-backed applications without setting up a production-grade database driver.
  • Migrating legacy Python 2 applications to Python 3 while maintaining PostgreSQL connectivity.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes, for development and testing.

psycopg2-binary is the most widely used PostgreSQL adapter for Python and is actively maintained. The binary distribution removes compiler dependencies, making it straightforward to install. For production deployments, consider the source-built psycopg2 package instead. No known security vulnerabilities and LGPL licensing is compatible with most projects.

Install

psycopg2-binary on PyPI

Before you install

Medium install friction due to binary wheel distribution; pre-compiled wheels available for common platforms (macOS, Linux, Windows) across multiple architectures, avoiding the need for a C compiler and development libraries at install time. Actively maintained with recent releases.

Requires a running PostgreSQL server accessible at the connection string provided; psycopg2-binary is a client library and does not include or start a database server.

License in practice

Licensed under LGPL with exceptions (copyleft). Derivative works and modifications must be distributed under compatible terms, but linking to psycopg2-binary in a proprietary application is generally permitted under the exception clause.

Quickstart

pip install psycopg2-binary

import psycopg2
conn = psycopg2.connect("dbname=test user=postgres")
cur = conn.cursor()
cur.execute("SELECT * FROM table")
results = cur.fetchall()

Verify before relying

  • Whether psycopg2-binary's pre-compiled binaries are suitable for production deployments or if source-built psycopg2 is recommended instead (description notes binary is practical for development/testing).
  • Performance characteristics and any runtime overhead of the binary distribution compared to source-compiled builds.

Package facts

LicenseLGPL with exceptions copyleft
Python supportSupports the current Python release >=3.9
Install frictionMedium. Platform-specific wheel
Runtime dependenciesNone
MaintenanceActively maintained 116 days since the last release
Last repo commit
First released
Downloads271,618,065 / month, #149 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
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

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

Tags

Capabilities
postgresql python adapterpostgres database driverpython db api postgresqlpsycopg2 binary packagethread-safe postgres connectionpython postgresql clientdb-api 2.0 postgres
Topics
database-driverpostgresqlthread-safe

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “python db api postgresql”

  • psycopg2-binarypsycopg2-binary is a PostgreSQL database adapter for Python that…
  • psycopg2PostgreSQL database adapter for Python that implements the DB API 2.0…
  • django-db-connection-poolProvides connection pooling for Django database backends (MySQL,…

Give your agent the search over MCP, or paste the wish link into any chat.

More Software Development packages

typing-extensions Worth it
PyPI · Software Development · released Jul 2026

Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.

PSF-2.0pure Python · 3.9+
1.9Bdownloads / mo
numpy Worth it
PyPI · Software Development · released Aug 2026

NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.

BSD-3-Clause AND 0BSD AND MIT AND Zlib AND CC0-1.0compiled wheel · 3.12+
1.1Bdownloads / mo
fastapi Worth it
PyPI · Software Development · released Jul 2026

FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.

MITpure Python · 3.10+
568.6Mdownloads / mo
annotated-doc With conditions
PyPI · Software Development · released Jul 2026

Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.

MITpure Python · 3.9+
456.2Mdownloads / mo
typer Worth it
PyPI · Software Development · released Aug 2026

Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.

Install it if you are building CLIs in Python.

MITpure Python · 3.10+
369.3Mdownloads / mo
distlib With conditions
PyPI · Software Development · released Jun 2026

Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.

permissive licensepure Python
323.3Mdownloads / mo

See also aws-psycopg2 · pgcopy · psycopg2 · PyGreSQL · pg8000 · psycopg · psycopg-binary · psycopg-c · psycogreen · psycopg-pool