Skip to content
Agents tracked: 506 Releases (7d): 634 Agent status: 4 with issuesSince last limit reset: Claude 15d · Codex 0d For AI agents: Markdown Updated Nov 26, 2026

psycopg2

Popular PostgreSQL adapter for Python with full database access and query execution.

Databases, ORMs and clientsPYPI

GitHubWebsite

1. License

License from PyPI classifier.

github.com/psycopg/psycopg2

From the package registry and GitHub, checked daily. Tap a verdict to see its source.How we checkedReport an error

What psycopg2 does

Popular PostgreSQL adapter for Python with full database access and query execution.

psycopg2 popularity

71 / 100
Gid Score, #340 overall
55.6M
downloads a week, pypi
3,666
GitHub stars
99
agent projects use it
psycopg2: downloads per weekPyPI, psycopg2-binary 55,488,721
psycopg2: GitHub starspsycopg/psycopg2 3,666

Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated

How psycopg2 is used

  • psycopg2 is a dependency in 99 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (6.1% of the 1,623 Python ones), #7 of 120 in databases, orms and clients.
  • Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 664; those are left out of every share on this page.
  • The most used alternative in our scan is SQLAlchemy (181 projects).
  • Projects that use it most often also use python-dotenv (72.7%), Uvicorn (63.6%), FastAPI (61.6%).

By coding agent

46 projects, 1.5%
42 projects, 1.7%
42 projects, 1.3%
6 projects, 2.2%
6 projects, 1.8%

Often used with

In 72.7% of its projects
In 63.6% of its projects
In 61.6% of its projects
In 61.6% of its projects
In 57.6% of its projects
In 44.4% of its projects
In 42.4% of its projects
In 41.4% of its projects

More about psycopg2

Funding
  • GitHub Sponsors: https://github.com/dvarrazzo
  • Own page: https://www.paypal.me/dvarrazzo
  • 30 GitHub sponsors

See all

Head to head
More in Databases, ORMs and clients

Alternatives

psycopg2 This page

LGPLGid 7155.6M/wk

SQLAlchemy

Python SQL toolkit and object-relational mapper for database abstraction.

MITGid 80105M/wk

asyncpg

Fast asyncio PostgreSQL driver for non-blocking database operations in Python.

Apache-2.0Gid 7136.3M/wk

PyMySQL

Pure Python MySQL database driver for database operations.

MITGid 6519.9M/wk

Neo4j

Official Python driver for Neo4j graph database with Bolt protocol.

Apache-2.0 AND Python-2.0Gid 543.6M/wk

PyMongo

Official MongoDB Python driver for querying and managing MongoDB databases.

Apache-2.0Gid 6818.5M/wk

Compare psycopg2 with another tool

Get started

Install it.

pip install psycopg2-binary

No step-by-step start for psycopg2 yet: we have not written its hand-checked card.