pg0-embedded
Python API for pg0 - embedded PostgreSQL
Decision gist · record as of 2026-08-14
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.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- 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.
- 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 · maintenance · safety
MIT (permissive) — MIT license permits unrestricted use, modification, and distribution in both open-source and commercial projects with minimal obligations.
last release 2026-07-31 (14 days) · last repo commit 2026-07-31 · 106 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 83,255 downloads/mo, #14,087 on PyPI
Alternatives
Verify before relying
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()")- 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
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 on it.
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
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.
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.
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()")
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 |
| Classifiers | Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9 |
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
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 › “embedded postgresql python”
- pg0-embeddedEmbeds a PostgreSQL database directly in Python with zero…
- pgserverEmbeds a PostgreSQL server with pgvector extension into your Python…
- ase-db-backendsProvides database backend implementations for ASE, supporting…
Give your agent the search over MCP, or paste the wish link into any chat.
More Database packages
psycopg2-binary is a PostgreSQL database adapter for Python that implements the DB API 2.0 specification, enabling Python applications to connect to and query PostgreSQL databases with thread-safe concurrent operations.
Python client library for connecting to and executing commands against Redis key-value stores, supporting both synchronous and asynchronous operations.
Install it if your application needs to interact with Redis; the only prerequisite is a running Redis server instance.
YDB Python SDK is the official client library for connecting to and querying YDB databases from Python applications.
Install it if you need to connect Python applications to YDB databases.
Connects Python applications to Snowflake data warehouses using the DB API 2.0 specification, enabling SQL queries, data transfers, and warehouse operations.
sqlparse tokenizes SQL text into a tree of statements, clauses, and expressions, and provides functions to split scripts, format queries, and inspect parsed tokens without validating dialect or syntax.
Install it if you need to manipulate, format, or analyze SQL text programmatically.
Provides base adapter protocols and shared functionality that database adapters use to integrate with dbt-core, handling connections, dialect translation, relation caching, and core interface management.
See also pgserver · py-pglite · vecs · llama-index-vector-stores-postgres · pgvector · apache-airflow-providers-pgvector · adbc-driver-postgresql · pgvecto-rs · pg8000 · pgpq