$npx skillfedfor your agent

psycopg-c

PostgreSQL database adapter for Python -- C optimisation distribution

With conditionsPyPI Software DevelopmentReleased May 2026943.6K downloads / moLGPL-3.0-onlySource build

Decision gist · record as of 2026-08-14

sdist only — psycopg_c-3.3.4.tar.gz · builds from source
v3.3.4 · released 2026-05-01 · Python >=3.10

Yes, if you have a C compiler and PostgreSQL development headers available and are using Psycopg 3 in a performance-sensitive application. Install via `pip install "psycopg[c]"` to keep versions synchronized. If compilation fails, fall back to `pip install "psycopg[binary]"` instead. The LGPL-3.0-only license requires source disclosure if you distribute the linked software, so verify your deployment model first.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires a C compiler (gcc, clang, MSVC) and PostgreSQL development headers (libpq-dev or equivalent) installed on your system.
  • If these are unavailable, use `pip install "psycopg[binary]"` instead.
  • Installation has high friction: it requires a C compiler and library headers to build from source.

License · maintenance · safety

LGPL-3.0-only (copyleft) — Licensed under LGPL-3.0-only (copyleft). If you distribute software that links this package, you must make your source code available under compatible terms; static linking or bundling may trigger copyleft obligations depending on your deployment model.

last release 2026-05-01 (105 days) · last repo commit 2026-08-01 · 2,473 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 943,615 downloads/mo, #4,672 on PyPI

Verify before relying

pip install "psycopg[c]"

import psycopg
conn = psycopg.connect("postgresql://user:password@localhost/dbname")
  • Whether the C extension provides measurable performance gains for typical workloads compared to pure-Python alternatives.
  • Whether pre-built binary wheels are available for your platform, or if local compilation is always required.
  • How the package integrates with higher-level database libraries and ORMs.
Same gist for agents: .md · .json

What it is and what it does

psycopg-c is an optional compiled extension for Psycopg 3, the PostgreSQL database adapter for Python. It is not a standalone package but rather a performance-optimization layer that sits on top of the main adapter library. When installed, it replaces certain hot-path Python functions with C-compiled equivalents to reduce overhead during database operations.

The package is distributed separately because compilation requires build tools and system libraries that not all environments have available. The documentation explicitly recommends installing it via `pip install "psycopg[c]"` rather than directly, so that the version stays synchronized with your installed adapter version. If compilation fails due to missing prerequisites, the fallback is `psycopg[binary]`, which provides pre-built wheels.

Use it for

  • Accelerate database queries in production applications where round-trip latency or data marshalling is a bottleneck.
  • Reduce CPU overhead in high-throughput data pipelines that execute many small queries or process large result sets.
  • Optimize long-running ETL jobs that rely on the adapter for bulk data movement between PostgreSQL and Python.
  • Speed up applications by compiling the adapter layer to reduce interpreter overhead.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you have a C compiler and PostgreSQL development headers available and are using Psycopg 3 in a performance-sensitive application.

Install via `pip install "psycopg[c]"` to keep versions synchronized. If compilation fails, fall back to `pip install "psycopg[binary]"` instead. The LGPL-3.0-only license requires source disclosure if you distribute the linked software, so verify your deployment model first.

Install

psycopg-c on PyPI

Before you install

Installation has high friction: it requires a C compiler and library headers to build from source. The package is actively maintained (last commit 2026-08-01, 105 days since release), but you should only install this directly if you understand the build prerequisites—the documentation recommends using `pip install "psycopg[c]"` instead, or falling back to `psycopg[binary]` if compilation fails.

Requires a C compiler (gcc, clang, MSVC) and PostgreSQL development headers (libpq-dev or equivalent) installed on your system. If these are unavailable, use `pip install "psycopg[binary]"` instead.

License in practice

Licensed under LGPL-3.0-only (copyleft). If you distribute software that links this package, you must make your source code available under compatible terms; static linking or bundling may trigger copyleft obligations depending on your deployment model.

Quickstart

pip install "psycopg[c]"

import psycopg
conn = psycopg.connect("postgresql://user:password@localhost/dbname")

Verify before relying

  • Whether the C extension provides measurable performance gains for typical workloads compared to pure-Python alternatives.
  • Whether pre-built binary wheels are available for your platform, or if local compilation is always required.
  • How the package integrates with higher-level database libraries and ORMs.

Package facts

LicenseLGPL-3.0-only copyleft
Python supportSupports the current Python release >=3.10
Install frictionHigh. Source build required
Runtime dependenciesNone
MaintenanceActively maintained 105 days since the last release
Last repo commit
First released
Downloads943,615 / month, #4,672 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 5 - Production/StableIntended Audience :: DevelopersOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: POSIXProgramming Language :: CythonProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Implementation :: CPythonTopic :: DatabaseTopic :: Database :: Front-EndsTopic :: Software DevelopmentTopic :: Software Development :: Libraries :: Python Modules

Evidence: psycopg_c-3.3.4.tar.gz

Tags

Capabilities
psycopg c extensionpostgresql python performancepsycopg optimizationcompiled database adapterpsycopg speeduppostgresql c bindingspsycopg3 performance boost
Topics
performance-optimizationc-extensionpostgresql

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “psycopg c extension”

Give your agent the search over MCP, or paste the wish link into any chat.

More Software Development packages

typing-extensions Worth it
PyPI · Software Development · released Jul 2026

Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.

PSF-2.0pure Python · 3.9+
1.9Bdownloads / mo
numpy Worth it
PyPI · Software Development · released Aug 2026

NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.

BSD-3-Clause AND 0BSD AND MIT AND Zlib AND CC0-1.0compiled wheel · 3.12+
1.1Bdownloads / mo
fastapi Worth it
PyPI · Software Development · released Jul 2026

FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.

MITpure Python · 3.10+
568.6Mdownloads / mo
annotated-doc With conditions
PyPI · Software Development · released Jul 2026

Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.

MITpure Python · 3.9+
456.2Mdownloads / mo
typer Worth it
PyPI · Software Development · released Aug 2026

Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.

Install it if you are building CLIs in Python.

MITpure Python · 3.10+
369.3Mdownloads / mo
distlib With conditions
PyPI · Software Development · released Jun 2026

Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.

permissive licensepure Python
323.3Mdownloads / mo

See also psycopg-binary · psycopg · psycopg-pool · psycopg2-binary · psycopg2 · types-psycopg2 · django-db-geventpool · PyGreSQL · postgres · sqlalchemy-cockroachdb

Further reading