psycopg
Psycopg 3 is a modern PostgreSQL database adapter for Python that provides both pure-Python and optimized C implementations. It supports connection pooling, async operations, and is designed as a successor to earlier Psycopg versions.
Key facts
Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.
| Field | Value |
|---|---|
| Repository | psycopg/psycopg |
| Owner | psycopg |
| Primary language | Python |
| License | LGPL-3.0 — OSI-approved |
| Stars | 2.4k |
| Forks | 251 |
| Open issues | 71 |
| Latest release | Unknown |
| Last updated | 2026-07-01 |
| Source | https://github.com/psycopg/psycopg |
What psycopg is
A Python database driver for PostgreSQL with modular architecture: pure Python core (psycopg), optional C/Cython performance module (psycopg_c), and separate connection pool package (psycopg_pool). Runtime dependency on libpq; development requires C build tools for optimizations.
Get the psycopg source
Clone the repository and explore it locally.
git clone https://github.com/psycopg/psycopg.gitcd psycopg# follow the project's README for install & configurationNeed it deployed, integrated, or customized instead? DEV.co ships production installs.
Best use cases
Implementation considerations
- libpq system library must be installed pre-deployment (Debian, macOS, Windows all supported); verify availability in target environment.
- Repository contains multiple independent packages (psycopg, psycopg_c, psycopg_pool) with potentially different release cycles; plan updates accordingly.
- C extension (psycopg_c) is optional but requires development tools and compilation; performance gains vs. deployment complexity tradeoff should be evaluated.
- Connection pool (psycopg_pool) is separate package; applications using pooling require explicit installation beyond base psycopg.
- Pure Python implementation works without C toolchain; suitable for rapid prototyping but may have performance overhead vs. compiled version.
When to avoid it — and what to weigh
- PostgreSQL not available — This is a PostgreSQL-specific adapter; projects using other databases (MySQL, SQLite, etc.) require different drivers.
- Minimal deployment dependencies required — Runtime requires libpq system library; environments with strict dependency restrictions or no package management may face friction.
- No version stability guarantee needed — Latest release status is listed as n/a; unclear versioning or release cadence may be problematic for projects requiring strict SLA versions.
- Proprietary/closed-source commercial software — LGPL-3.0 requires careful review; LGPL obligations regarding linking and source distribution disclosure must be evaluated by legal/compliance teams.
License & commercial use
Licensed under LGPL-3.0 (GNU Lesser General Public License v3.0). This is a copyleft license with source-code-level obligations.
LGPL-3.0 permits commercial use, but imposes obligations: derivative works must be distributed under LGPL-3.0, and if you distribute the software, you must provide recipients access to source code and allow modification. Linking (static or dynamic) triggers obligations. Requires legal review before use in proprietary products; web/SaaS deployment may have different obligations than traditional distribution. Do not assume freedom to use without compliance assessment.
DEV.co evaluation signals
Editorial assessment — not user reviews. Directional, with an explicit confidence level.
| Signal | Assessment |
|---|---|
| Maintenance | Active |
| Documentation | Adequate |
| License clarity | Clear |
| Deployment complexity | Moderate |
| DEV.co fit | Good |
| Assessment confidence | High |
No security audit data, known CVEs, or security posture documented in provided sources. Standard database driver attack surface applies: SQL injection depends on application code (not driver), connection string handling, and libpq configuration. LGPL source availability aids third-party audits. Requires review of official security policy/changelog for vulnerability history.
Alternatives to consider
asyncpg
Pure-Python async PostgreSQL driver; faster for async workloads, no libpq dependency, but less feature-parity with psycopg3 for synchronous use.
SQLAlchemy (with psycopg)
ORM abstraction over psycopg; adds data modeling layer and database portability, but introduces abstraction overhead and dependency chain.
psycopg2
Earlier Psycopg generation; stable and widely deployed, but no async support and less modern architecture than psycopg3.
Build on psycopg with DEV.co software developers
Review licensing obligations, libpq dependencies, and modular architecture before adopting. Consult our team if compliance or deployment complexity are concerns.
Talk to DEV.coRelated open-source tools
Surfaced by semantic similarity across the DEV.co open-source index.
Related on DEV.co
Explore the category and the services that help you build with it.
psycopg FAQ
Do I need libpq installed?
Is the C extension required?
Can I use this for async applications?
What is the difference between psycopg, psycopg_c, and psycopg_pool?
Software developers & web developers for hire
DEV.co is a software development agency delivering custom software development services to companies building on open source. Our software developers and web developers design, integrate, and ship production systems — spanning web development, APIs, AI, data, and cloud. If psycopg is part of your open-source databases roadmap, our team can implement, customize, migrate, and maintain it.
Evaluate Psycopg 3 for Your PostgreSQL Project
Review licensing obligations, libpq dependencies, and modular architecture before adopting. Consult our team if compliance or deployment complexity are concerns.