pg0-embedded
Python API for pg0 - embedded PostgreSQL
What it is and what it does
pg0-embedded is a Python wrapper that bundles PostgreSQL as an embedded database, eliminating the need for separate installation, Docker, or configuration management. It starts a PostgreSQL instance directly from Python code and provides a simple API to execute SQL queries, manage the instance lifecycle, and retrieve connection details. The package includes pgvector extension support out of the box, making it suitable for applications that need vector similarity search alongside traditional SQL operations.
The package is designed for rapid prototyping, testing, and development workflows where spinning up a full PostgreSQL server is overhead. It works as a context manager for automatic startup and shutdown, or as standalone instance management with explicit start/stop calls. Connection URIs are generated automatically, and the instance runs on localhost with configurable port, username, password, and database name.
Use it for:
- Rapid prototyping and development when you need SQL and vector search without infrastructure setup
- Automated testing that requires a real PostgreSQL database without Docker or external services
- Building AI/ML applications with pgvector for semantic search and embeddings in a single Python process
- Distributing Python applications that need embedded database functionality without end-user PostgreSQL installation
- Local development environments where Docker overhead or complexity is undesirable
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Embeds a PostgreSQL database directly in Python with zero configuration, no Docker required, and built-in pgvector support for vector operations.
Yes, if you need PostgreSQL with pgvector in a development or testing context and want to avoid Docker or external database setup. The active maintenance, zero security vulnerabilities, permissive MIT license, and broad platform support make it low-risk. Medium install friction (platform-specific wheels) is a minor trade-off for the convenience of zero-config embedded operation. Not suitable if you need persistent data across application restarts or production-grade database isolation—verify persistence behavior before relying on it for stateful applications.
Install
pg0-embedded on PyPI
pip
pip install pg0-embeddeduv
uv add pg0-embeddedpoetry
poetry add pg0-embeddedInstalling pg0-embedded
Before you install
Medium install friction due to platform-specific wheels (macOS arm64/x86_64, Linux x86_64/aarch64, Windows x64); active maintenance with recent release (14 days old) and 106 repository stars suggest ongoing support.
License in practice
MIT license permits unrestricted use, modification, and distribution in both open-source and commercial projects with minimal obligations.
Quickstart
pip install pg0-embedded
from pg0 import Pg0
with Pg0() as pg:
print(pg.uri)
pg.execute("CREATE EXTENSION IF NOT EXISTS vector")
pg.execute("SELECT version()")
Requires Python 3.8 or later; pre-built wheels available for macOS (arm64, x86_64), Linux (x86_64, aarch64), and Windows (x64) only—other platforms require Rust toolchain to build from source.
Verify before relying
- Whether the embedded PostgreSQL instance persists data across application restarts by default or requires explicit configuration
- Performance characteristics and resource overhead compared to external PostgreSQL instances
- Compatibility with existing PostgreSQL tools, drivers, and ORMs beyond the basic URI connection
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 14 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 83,255/month — #14,087 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pg0_embedded-0.15.1-py3-none-macosx_14_0_arm64.whl; pg0_embedded-0.15.1-py3-none-macosx_15_0_x86_64.whl; pg0_embedded-0.15.1-py3-none-manylinux_2_35_aarch64.whl; pg0_embedded-0.15.1-py3-none-manylinux_2_35_x86_64.whl; pg0_embedded-0.15.1-py3-none-win_amd64.whl
Keywords: database, embedded, pgvector, postgresql
Tags
More Database packages
psycopg2-binary is a PostgreSQL database…
copyleft · top 1,000 on PyPI
redisPython client library for connecting to and…
permissive · top 1,000 on PyPI
ydbYDB Python SDK is the official client library…
permissive · top 1,000 on PyPI
snowflake-connector-pythonConnects Python applications to Snowflake data…
permissive · top 1,000 on PyPI
sqlparsesqlparse tokenizes SQL text into a tree of…
permissive · top 1,000 on PyPI
dbt-adaptersProvides base adapter protocols and shared…
permissive · top 1,000 on PyPI
pgserverEmbeds a PostgreSQL server with pgvector…
unclear · top 15,000 on PyPI
py-pglitepy-pglite provides a zero-config PostgreSQL…
permissive · top 15,000 on PyPI
vecsvecs is a Python client for storing, indexing,…
permissive · top 15,000 on PyPI
llama-index-vector-stores-postgresIntegrates PostgreSQL with pgvector extension…
permissive · top 15,000 on PyPI
pgvectorAdds vector storage and similarity search…
permissive · top 1,000 on PyPI
apache-airflow-providers-pgvectorIntegrates pgvector operations into Apache…
permissive · top 15,000 on PyPI
adbc-driver-postgresqlProvides a DBAPI 2.0-compatible Python…
permissive · top 5,000 on PyPI
pgvecto-rsProvides Python bindings for PGVecto.rs, a…
permissive · top 15,000 on PyPI
pg8000pg8000 is a pure-Python PostgreSQL driver that…
permissive · top 1,000 on PyPI
pgpqEncodes PyArrow RecordBatches into PostgreSQL's…
permissive · top 15,000 on PyPI