asyncpg vs psycopg
In 1,621 Python projects set up for AI coding agents, asyncpg is a dependency in 68 (4.2%) and psycopg in 70 (4.3%), close to even. Among repos created in the last 90 days that use a databases, orms and clients tool, asyncpg is in 28.0% and psycopg in 32.0%, against 15.8% and 16.1% of older ones. 11 projects list both, often a sign of a migration or of a monorepo with several apps.
Databases, ORMs and clients PyPI Updated Nov 17, 2026
Side by side
| asyncpg | psycopg | |
|---|---|---|
| Agent projects that use it | 68 | 70 |
| Rank in databases, orms and clients | #11 | #10 |
| In new repos with a databases, orms and clients tool (last 90 days) | 28.0% | 32.0% |
| In older repos with one | 15.8% | 16.1% |
| Downloads, last 7 days | 35.1M | 55.1M |
| GitHub stars | 8,120 | 2,533 |
| Last push to its repo | Oct 8, 2026 | Nov 12, 2026 |
| License | Apache-2.0 | LGPL-3.0-only |
| Funding | — | — |
| Projects that list both | 11 | |
Downloads include CI runs and installs as a dependency of other packages. Stars and pushes are from GitHub's API; downloads from PyPI.
By coding agent
| Projects set up for | Python repos | asyncpg | psycopg |
|---|---|---|---|
| Claude Code | 782 | 5.4% | 5.0% |
| GitHub Copilot | 805 | 4.1% | 3.7% |
| Cursor | 548 | 6.4% | 6.4% |
| Gemini CLI | 83 | 6.0% | 8.4% |
| OpenCode | 53 | 0% | 9.4% |
| Devin Desktop | 60 | 8.3% | 8.3% |
Share of the Python repos configured for each agent (its config file in the repo) that list the tool. A repo set up for two agents counts for both.
asyncpg
Fast asyncio PostgreSQL driver for non-blocking database operations in Python.
Most often used with it:
| FastAPI | 89.7% of its projects |
|---|---|
| Uvicorn | 85.3% of its projects |
| Pydantic | 82.4% of its projects |
| SQLAlchemy | 75.0% of its projects |
| python-dotenv | 58.8% of its projects |
pip install asyncpg
psycopg
PostgreSQL database adapter for Python with async support.
Most often used with it:
| python-dotenv | 60.0% of its projects |
|---|---|
| FastAPI | 51.4% of its projects |
| Uvicorn | 50.0% of its projects |
| Pydantic | 47.1% of its projects |
| Requests | 42.9% of its projects |
pip install psycopg
More matchups
psycopg2 vs asyncpgasyncpg vs aiosqlitePrisma vs Drizzle ORMpg vs Neon Serverless Driver
How we count
Projects are public GitHub repos our weekly scan finds through coding-agent config files (CLAUDE.md, AGENTS.md, .cursor/mcp.json and others); a project uses a tool when its package.json, requirements.txt or pyproject.toml lists it. "Same job" was checked for every pair, so add-ons and companions are never paired. Shares by repo age compare repos created in the last 90 days with older ones in the same scan. More on the method.