pg8000
PostgreSQL interface library
Decision gist · record as of 2026-08-14
Yes, if you need a PostgreSQL driver without compiled dependencies. pg8000 is stable (production-ready since 2008), permissively licensed, and has no known vulnerabilities. The 334-day gap since last release suggests maintenance-only status rather than active development, but the package is mature and widely used (top 1000 on PyPI). Install it when pure-Python portability matters more than performance, or when you cannot use psycopg2 due to environment constraints.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires a running PostgreSQL server accessible at the specified host and port; connection credentials (user, password) must be valid.
- Low install friction with only two runtime dependencies (python-dateutil and scramp).
- Last release was 334 days ago, marking the package as aging but stable—it has been in production use since 2008 and maintains support across Python 3.9 through 3.13.
License · maintenance · safety
BSD 3-Clause License (permissive) — Distributed under the BSD 3-Clause License (permissive), which allows commercial and private use with minimal restrictions beyond attribution and liability disclaimers.
last release 2025-09-14 (334 days)
0 known vulnerabilities (OSV.dev, 2026-08-14) · 44,916,330 downloads/mo, #624 on PyPI
Alternatives
Verify before relying
import pg8000.native
conn = pg8000.native.Connection(
user='postgres',
host='localhost',
password='password',
database='mydb'
)
results = conn.run('SELECT * FROM table')
conn.close()- Performance characteristics compared to other PostgreSQL drivers (psycopg2, asyncpg) are not documented in the fact sheet.
- Whether the package is actively maintained or in maintenance-only mode given the 334-day gap since last release.
What it is and what it does
pg8000 is a pure-Python PostgreSQL driver that speaks the PostgreSQL wire protocol directly without requiring compiled extensions. It implements the DB-API 2.0 standard, meaning it follows the same interface conventions as other Python database drivers, making it easy to swap in or out of projects. The package depends only on python-dateutil (for date/time handling) and scramp (for SCRAM authentication), keeping the dependency footprint minimal.
You can use pg8000 in two ways: via its native API for direct control over PostgreSQL-specific features like prepared statements, server-side cursors, and replication protocol, or via its DB-API 2.0 interface for standard SQL operations. It handles type mapping between Python and PostgreSQL types, supports SSL connections, transactions, and binary large objects (BLOBs). The driver is suitable for applications that need PostgreSQL connectivity without the overhead of compiled C extensions.
Use it for
- Building Python web applications or data pipelines that need to query PostgreSQL without installing psycopg2's C dependencies.
- Connecting to PostgreSQL from PyPy or other Python implementations where compiled drivers may not be available.
- Applications requiring prepared statements, server-side cursors, or PostgreSQL replication protocol support.
- Environments where pure-Python dependencies are preferred for portability or security scanning simplicity.
- Projects using DB-API 2.0 that need to switch database drivers with minimal code changes.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need a PostgreSQL driver without compiled dependencies.
pg8000 is stable (production-ready since 2008), permissively licensed, and has no known vulnerabilities. The 334-day gap since last release suggests maintenance-only status rather than active development, but the package is mature and widely used (top 1000 on PyPI). Install it when pure-Python portability matters more than performance, or when you cannot use psycopg2 due to environment constraints.
Install
pg8000 on PyPI
Before you install
Low install friction with only two runtime dependencies (python-dateutil and scramp). Last release was 334 days ago, marking the package as aging but stable—it has been in production use since 2008 and maintains support across Python 3.9 through 3.13.
Requires a running PostgreSQL server accessible at the specified host and port; connection credentials (user, password) must be valid.
License in practice
Distributed under the BSD 3-Clause License (permissive), which allows commercial and private use with minimal restrictions beyond attribution and liability disclaimers.
Quickstart
import pg8000.native
conn = pg8000.native.Connection(
user='postgres',
host='localhost',
password='password',
database='mydb'
)
results = conn.run('SELECT * FROM table')
conn.close()
Verify before relying
- Performance characteristics compared to other PostgreSQL drivers (psycopg2, asyncpg) are not documented in the fact sheet.
- Whether the package is actively maintained or in maintenance-only mode given the 334-day gap since last release.
Package facts
| License | BSD 3-Clause License permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagespython-dateutilscramp |
| Maintenance | Aging 334 days since the last release |
| First released | |
| Downloads | 44,916,330 / month, #624 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Programming Language :: Python :: ImplementationProgramming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Database :: Front-EndsTopic :: Software Development :: Libraries :: Python Modules |
Evidence: pg8000-1.31.5-py3-none-any.whl
Tags
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 › “db-api 2.0 postgresql”
- pg8000pg8000 is a pure-Python PostgreSQL driver that implements the DB-API…
- psycopg2-binarypsycopg2-binary is a PostgreSQL database adapter for Python that…
- aurora-data-apiA DB-API 2.0 compatible client for AWS Aurora Serverless that tunnels…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also psycopg2 · psycopg2-binary · adbc-driver-postgresql · PyGreSQL · cx-Oracle · pymgclient · psycopg · PyMySQL · pg0-embedded · vertica-python