--- id: pg0-embedded version: "0.15.1" license: MIT license_treatment: permissive maintenance: active --- # pg0-embedded — Python API for pg0 - embedded PostgreSQL License: permissive · Maintenance: active · Downloads: 83.3K/mo ## 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 above — 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 pip install pg0-embedded uv add pg0-embedded poetry add pg0-embedded ## Installing 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_current - Install friction: medium - Maintenance: active - Downloads: 83.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags embedded postgresql python, zero-config postgres, pgvector python, in-process database, postgresql without docker, vector database python, portable postgres, embedded-database, vector-search, testing [View on SkillFed](https://skillfed.io/packages/pg0-embedded) · [View on PyPI](https://pypi.org/project/pg0-embedded/)