pg8000
PostgreSQL interface library
Install
pg8000 on PyPI
pip
pip install pg8000uv
uv add pg8000poetry
poetry add pg8000Package 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 — python-dateutil, scramp |
| Maintenance | aging — 333 days since the last release |
| First released | |
| Popularity | one of the top 1,000 most-downloaded packages on PyPI (30-day window, as of 2026-08-13) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-13) |
Evidence: pg8000-1.31.5-py3-none-any.whl
Keywords: dbapi, postgresql
About pg8000
from the package's own PyPI description — quoted content, verbatim
pg8000
pg8000 is a pure-Python PostgreSQL driver that complies with DB-API 2.0. pg8000's name comes from the belief that it is probably about the 8000th PostgreSQL interface for Python. pg8000 is distributed under the BSD 3-clause license.
<!-- mtoc-start -->
- Installation
- Native API Interactive Examples
- Basic Example
- Transactions
- Query Using Functions
- Interval Type
- Point Type
- Client Encoding
- JSON
- Retrieve Column Metadata From Results
- Notices And Notifications
- Parameter Statuses
- LIMIT ALL
- IN and NOT IN
- Many SQL Statements Can't Be Parameterized
- COPY FROM And TO A Stream
- Execute Multiple SQL Statements *...
AI interpretation — verify before relying
AI-generated interpretation of the package facts above; every digit, version, license, or vulnerability id it cites is grounded in the facts already shown on this page
pg8000 is a pure-Python PostgreSQL driver that implements the DB-API 2.0 standard, enabling Python applications to connect to and query PostgreSQL databases without compiled dependencies.
Installation friction is low with only two runtime dependencies (python-dateutil and scramp), both common and lightweight. The package is marked as aging (333 days since last release), which is typical for stable database drivers but warrants checking that it remains compatible with your PostgreSQL version and Python 3.9+ environment.
pg8000 is distributed under the BSD 3-Clause License, a permissive open-source license that allows commercial and private use with minimal restrictions—you need only include the license text in distributions.
Usage
import pg8000.native
conn = pg8000.native.Connection(
user='postgres',
host='localhost',
password='password',
database='mydb'
)
results = conn.run('SELECT * FROM users')
conn.close()
Requires a running PostgreSQL server accessible at the specified host and port (default 5432), and valid authentication credentials.
Verdict: pg8000 is a stable, permissively licensed PostgreSQL driver suitable for Python 3.9+ applications that need DB-API 2.0 compliance without compiled dependencies. Low install friction and no known vulnerabilities make it a reliable choice, though its aging status (333 days since release) means you should verify compatibility with your specific PostgreSQL version before adoption.
Needs verification
- Whether the 333-day release gap reflects active maintenance or dormancy—check the repository's commit history and issue response times.
- Compatibility with the specific PostgreSQL version(s) you plan to use.
- Performance characteristics compared to other pure-Python or compiled PostgreSQL drivers for your workload.
Similar packages
permissive · top 1,000 on PyPI
psycopg2copyleft · top 1,000 on PyPI
pymssqlcopyleft · top 1,000 on PyPI
psycopg2-binarycopyleft · top 1,000 on PyPI
asyncpgpermissive · top 1,000 on PyPI
psycopgcopyleft · top 1,000 on PyPI
sqlparsepermissive · top 1,000 on PyPI
oracledbunclear · top 1,000 on PyPI
psycopg-poolcopyleft · top 1,000 on PyPI
pyodbcpermissive · top 1,000 on PyPI