psycopg/psycopg2

PostgreSQL database adapter for the Python programming language

View on GitHub ↗Jump to charts ↓Open shareable report

Summary Information

Updated 2 minutes ago
Type:Library / SDKCategory(s):Relational & SQL DatabasesDatabases & Storage
Added to GitGenius on September 19th, 2026
Created on January 21st, 2013
Open Issues & Pull Requests: 16 (+0)
GitHub issues: Enabled
Number of forks: 543
Total Stargazers: 3,655 (+0)
Total Subscribers: 69 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 2.5 hours
Mean response time: 14.4 days
90th percentile: 26.0 hours
Tracked items: 104

Most active contributors

Sign in to see contributor activity.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 1
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 2,384 days
Stale 30+ days: 1
Stale 90+ days: 1

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • wheel (2)
  • enhancement (1)
  • feature request (1)
  • funding required (1)

Most active issues this week

Detailed Description

Psycopg2 is a PostgreSQL database adapter for the Python programming language that implements the Python DB API 2.0 specification.

The tool solves the problem of connecting Python applications to PostgreSQL databases with thread safety and efficiency. It is implemented primarily in C as a wrapper around libpq, enabling both secure and performant database operations. The adapter supports client-side and server-side cursors, asynchronous communication, server notifications, and COPY operations. Many Python types map automatically to PostgreSQL data types, and the adaptation system allows customization for additional types.

Psycopg2 suits applications that require stable, mature PostgreSQL connectivity with multi-threaded access patterns. It handles scenarios involving concurrent inserts and updates across multiple threads sharing the same connection. The tool is Unicode and Python 3 compatible. However, the README notes that while the package remains actively maintained, new features are not expected in this version. For projects starting fresh, the README recommends considering Psycopg 3, where active feature development occurs.

The project maintains its codebase through automated testing via continuous integration workflows. Documentation is provided both within the repository and online. Installation is straightforward through standard Python package management, with options for both source builds and pre-compiled binary packages, though source builds are recommended for production use.