Skip to main content

pg0 - PostgreSQL for Python

PyPI

Zero-config PostgreSQL with pgvector. No installation, no Docker, no configuration.

Install

pip install pg0-embedded

Usage

from pg0 import Pg0

# Basic usage
with Pg0() as pg:
    print(pg.uri)  # postgresql://postgres:postgres@127.0.0.1:5432/postgres
    pg.execute("CREATE EXTENSION IF NOT EXISTS vector")
    pg.execute("SELECT version()")

# Custom configuration
pg = Pg0(
    name="myapp",
    port=5433,
    username="myuser",
    password="mypass",
    database="mydb",
    config={"shared_buffers": "512MB"}
)
pg.start()
pg.stop()

API

Pg0 Class

Method Description
start() Start PostgreSQL, returns InstanceInfo
stop() Stop PostgreSQL
drop() Stop and delete all data
info() Get instance info
execute(sql) Run SQL query
uri Connection URI (property)
running Check if running (property)

Module Functions

import pg0

pg0.start(name="default", port=5432, ...)  # Start instance
pg0.stop(name="default")                    # Stop instance
pg0.drop(name="default")                    # Delete instance
pg0.info(name="default")                    # Get instance info
pg0.list_instances()                        # List all instances

Getting Connection URI

from pg0 import Pg0

pg = Pg0()
pg.start()

# Using the uri property
print(pg.uri)  # postgresql://postgres:postgres@127.0.0.1:5432/postgres

# Or using info()
info = pg.info()
print(info.uri)  # postgresql://postgres:postgres@127.0.0.1:5432/postgres
print(info.port)  # 5432
print(info.username)  # postgres
print(info.database)  # postgres

Runtime paths

Set PG0_EXECUTABLE to the absolute path of an existing pg0 executable to use it instead of the binary bundled in the wheel. An invalid override raises Pg0NotFoundError; it never silently falls back to the bundled binary.

The CLI also accepts PG0_HOME for writable instance state and PG0_INSTALLATION_DIR for extracted PostgreSQL and pgvector files. Both must be absolute paths and are inherited by SDK subprocesses. The installation root contains a version subdirectory, for example 18.1.0/bin/postgres.exe. --data-dir / Pg0(data_dir=...) continues to override an instance's data path. See runtime directories for provisioning and permission requirements.

Supported Platforms

Pre-built wheels are available for:

Platform Architecture Wheel Tag
macOS Apple Silicon (M1/M2/M3) macosx_14_0_arm64
Linux x86_64 (glibc) manylinux_2_35_x86_64
Linux ARM64 (glibc) manylinux_2_35_aarch64
Windows x64 win_amd64

For other platforms, install from source (requires Rust toolchain):

pip install pg0-embedded --no-binary pg0-embedded

Metadata

Release files for pg0-embedded 0.18.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pg0-embedded 0.18.0
File Size Uploaded Provenance Actions
pg0_embedded-0.18.0.tar.gz 22.2 kB With provenance Details for pg0_embedded-0.18.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for pg0-embedded 0.18.0
File Actions
pg0_embedded-0.18.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for pg0_embedded-0.18.0-py3-none-win_amd64.whl
pg0_embedded-0.18.0-py3-none-manylinux_2_35_x86_64.whl Python 3 none Linux glibc 2.35+ x86-64 Details for pg0_embedded-0.18.0-py3-none-manylinux_2_35_x86_64.whl
pg0_embedded-0.18.0-py3-none-manylinux_2_35_aarch64.whl Python 3 none Linux glibc 2.35+ ARM64 Details for pg0_embedded-0.18.0-py3-none-manylinux_2_35_aarch64.whl
pg0_embedded-0.18.0-py3-none-macosx_15_0_x86_64.whl Python 3 none macOS 15.0+ x86-64 Details for pg0_embedded-0.18.0-py3-none-macosx_15_0_x86_64.whl
pg0_embedded-0.18.0-py3-none-macosx_14_0_arm64.whl Python 3 none macOS 14.0+ ARM64 Details for pg0_embedded-0.18.0-py3-none-macosx_14_0_arm64.whl

Total release size: 356.3 MB

Release files / pg0_embedded-0.18.0.tar.gz

Download URL pg0_embedded-0.18.0.tar.gz
Size 22.2 kB
Tags Source
SHA-256 checksum
How to use checksums
c03ab5774e0dee5a7d9bd19c4d14c284fe98954742baab0d36eebb7f9ec8e221
BLAKE2b-256 checksum
How to use checksums
c68129db51fc022d67f33d94c330781e047b8d80ca4ad063e44ce41284311d6a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / pg0_embedded-0.18.0-py3-none-win_amd64.whl

Download URL pg0_embedded-0.18.0-py3-none-win_amd64.whl
Size 52.3 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
474d51bdf299f885058923a3fda9b296e75372933cd49eb4d0e09a98e719de9f
BLAKE2b-256 checksum
How to use checksums
6b9d2f95bf3d28a0615a1459298f3fcd632a75d6d9966853294346a445da2137
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / pg0_embedded-0.18.0-py3-none-manylinux_2_35_x86_64.whl

Download URL pg0_embedded-0.18.0-py3-none-manylinux_2_35_x86_64.whl
Size 58.9 MB
Tags Linux glibc 2.35+ x86-64 Python 3
SHA-256 checksum
How to use checksums
2d96c5e7382776ad5666b0b8d9b41739c7f80c1daa8deda8446a8e39dee1891c
BLAKE2b-256 checksum
How to use checksums
6e155a5a1996ef55faa050d60f4e9c02ef9aa2a90d75e3cb80b2c18396f94e04
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / pg0_embedded-0.18.0-py3-none-manylinux_2_35_aarch64.whl

Download URL pg0_embedded-0.18.0-py3-none-manylinux_2_35_aarch64.whl
Size 57.9 MB
Tags Linux glibc 2.35+ ARM64 Python 3
SHA-256 checksum
How to use checksums
85f43b089a6d5983a691a35039c9f7daed6acf74764dc3b6cf827a458c82d305
BLAKE2b-256 checksum
How to use checksums
f24a84d1c3026b2be799b617dca72716f9d41013ae0888b71e78d4a05ec0c0de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / pg0_embedded-0.18.0-py3-none-macosx_15_0_x86_64.whl

Download URL pg0_embedded-0.18.0-py3-none-macosx_15_0_x86_64.whl
Size 95.0 MB
Tags Python 3 macOS 15.0+ x86-64
SHA-256 checksum
How to use checksums
dc0186a3f7386e5e4a837430ef28ab5fd8f08b906ac3f3f27c2f1634b80c9f5b
BLAKE2b-256 checksum
How to use checksums
0c94efc3427fb5fa6f03f05d59be01add29ad3618138665e6592af50e85a1155
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / pg0_embedded-0.18.0-py3-none-macosx_14_0_arm64.whl

Download URL pg0_embedded-0.18.0-py3-none-macosx_14_0_arm64.whl
Size 92.2 MB
Tags Python 3 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
40b921783f894fabb7a69f2165b97c5ed77f674db9f37246c2160d12f2b22d6f
BLAKE2b-256 checksum
How to use checksums
4ea9a8d70569d3dbe6c0131009f66d2a145b4ae44d42d9f055b35b04f5c1e7bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Security for pg0-embedded 0.18.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for pg0_embedded-0.18.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page