psycopg
PostgreSQL database adapter for Python
Install
psycopg on PyPI
pip
pip install psycopguv
uv add psycopgpoetry
poetry add psycopgPackage facts
| License | LGPL-3.0-only (copyleft) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — typing-extensions, tzdata |
| Maintenance | actively maintained — 104 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: psycopg-3.3.4-py3-none-any.whl
About psycopg
from the package's own PyPI description — quoted content, verbatim
Psycopg 3: PostgreSQL database adapter for Python
Psycopg 3 is a modern implementation of a PostgreSQL adapter for Python.
This distribution contains the pure Python package psycopg.
.. Note::
Despite the lack of number in the package name, this package is the
successor of psycopg2_.
Please use the psycopg2 package if you are maintaining an existing program
using psycopg2 as a dependency. If you are developing something new,
Psycopg 3 is the most current implementation of the adapter.
.. _psycopg2: https://pypi.org/project/psycopg2/
Installation
In short, run the following::
pip install --upgrade pip # to upgrade pip
pip install "psycopg[binary,pool]" # to install package and dependencies
If something goes wrong, and for more information about installation, please
check out the Installation documentation__.
.. __: https://www.psycopg.org/psycopg3/docs/basic/install.html#
Hacking
For development information check out the project readme__.
.. __: https://github.com/psycopg/psycopg#readme
Copyright (C) 2020 The Psycopg Team
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
Psycopg 3 is a modern PostgreSQL database adapter for Python that enables applications to connect to and query PostgreSQL databases. It is the current successor to psycopg2 and provides both pure Python and optional binary implementations.
Low install friction with a pure Python wheel distribution and only two lightweight runtime dependencies (typing-extensions and tzdata). The project is actively maintained with recent commits and a stable production status, making it reliable for new projects.
Licensed under LGPL-3.0-only (copyleft), which requires that derivative works and modifications remain under the same license. Applications using psycopg as a library can do so without restriction, but any modifications to psycopg itself must be shared under LGPL-3.0-only terms.
Usage
pip install psycopg[binary,pool]
import psycopg
conn = psycopg.connect('postgresql://user:password@localhost/dbname')
cur = conn.cursor()
cur.execute('SELECT version()')
print(cur.fetchone())
Requires Python 3.10 or later; PostgreSQL server must be accessible at the connection string provided.
Verdict: Psycopg 3 is a production-ready PostgreSQL adapter with low installation friction, active maintenance, and no known security vulnerabilities. Its LGPL-3.0-only copyleft license is permissive for most use cases. Recommended for new Python projects requiring PostgreSQL connectivity.
Needs verification
- Whether the optional [binary,pool] extras are necessary for typical workloads or if the base package suffices
- Performance characteristics and connection pooling behavior compared to psycopg2 for migration decisions
Similar packages
copyleft · top 1,000 on PyPI
pg8000permissive · top 1,000 on PyPI
psycopg-binarycopyleft · top 1,000 on PyPI
asyncpgpermissive · top 1,000 on PyPI
psycopg2copyleft · top 1,000 on PyPI
psycopg2-binarycopyleft · top 1,000 on PyPI
pgvectorpermissive · top 1,000 on PyPI
peeweeunclear · top 1,000 on PyPI
dbt-adapterspermissive · top 1,000 on PyPI
opentelemetry-instrumentation-psycopg2permissive · top 1,000 on PyPI