Install & Compatibility
Where this runs
tested against v0.5.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
py 3.9
✕ build_error
✕ build_error
16MB installed
● package 16MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
PGlite
✓ from py_pglite import PGlite
✗ from pglite import PGlite
PGliteManager
✓ from py_pglite import PGliteManager
get_client
✓ from py_pglite import get_client
Basic usage: spin up ephemeral PostgreSQL and run a query.
import pglite
# Start an in-memory PostgreSQL instance
db = pglite.PGlite()
# Get a psycopg2 connection string
conn_str = db.get_connection_string()
print(conn_str)
# Connect using psycopg2
import psycopg2
conn = psycopg2.connect(conn_str)
cur = conn.cursor()
cur.execute("SELECT version();")
print(cur.fetchone()[0])
cur.close()
conn.close()
Upgrade
Version history
0.5.3latest on PyPI · released Sep 17, 2025
Audit
Dependencies
psycopg2-binaryoptionalDefault PostgreSQL driver used by py-pglite
SQLAlchemyoptionalFor SQLAlchemy engine/connection integration
asyncpgoptionalFor async PostgreSQL support
djangooptionalFor Django test runner integration
psycopgoptionalAlternative modern driver (psycopg 3)