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.17.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.17.0
File Size Uploaded Provenance Actions
pg0_embedded-0.17.0.tar.gz 22.2 kB With provenance Details for pg0_embedded-0.17.0.tar.gz

Built distributions (wheels)

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

Total release size: 149.3 MB

Release files / pg0_embedded-0.17.0.tar.gz

Download URL pg0_embedded-0.17.0.tar.gz
Size 22.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b1405fd3caff84f8e03d61ed062e956217de1b67a12a095a5a16b94b81a70ee8
BLAKE2b-256 checksum
How to use checksums
09726dedd75f77a4fcf505ca0b168db89980d1aee0ff8b2c6395ecbb0046ef49
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 17, 2026.

Transparency log

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

Download URL pg0_embedded-0.17.0-py3-none-win_amd64.whl
Size 55.5 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
6ab68646b59c74b2e32024865bf097e571b1a77bab9d2ee5705df2af52e59886
BLAKE2b-256 checksum
How to use checksums
6a27f199df57a0e5fbe9163cada199d1cc9e22cf829af411c2a9014ffe15ee48
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 17, 2026.

Transparency log

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

Download URL pg0_embedded-0.17.0-py3-none-manylinux_2_35_x86_64.whl
Size 30.8 MB
Tags Linux glibc 2.35+ x86-64 Python 3
SHA-256 checksum
How to use checksums
1aa031fe4700d3f1f36c8b04bd0e6bbc3f20709ccbd059b2b15ba651bbacbd10
BLAKE2b-256 checksum
How to use checksums
e19f0cabf1653cdb6dc0f904c3fe021ea8d7348780f2d85d77863d9005ad3b81
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 17, 2026.

Transparency log

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

Download URL pg0_embedded-0.17.0-py3-none-manylinux_2_35_aarch64.whl
Size 30.1 MB
Tags Linux glibc 2.35+ ARM64 Python 3
SHA-256 checksum
How to use checksums
2229c79004c8c9232104e4677c91de3dfa226a72a28c0347324f00a062b696dc
BLAKE2b-256 checksum
How to use checksums
c792b87ad746f314c808d0ae96b5a3855cae5b414529086975971aff7f34b42d
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 17, 2026.

Transparency log

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

Download URL pg0_embedded-0.17.0-py3-none-macosx_15_0_x86_64.whl
Size 16.7 MB
Tags Python 3 macOS 15.0+ x86-64
SHA-256 checksum
How to use checksums
66f923c2e6ca38051fcf5195d0aa4d08598f560a74a2113da26d829c732b4399
BLAKE2b-256 checksum
How to use checksums
e7207c35cd4ed9d1bf6071c510a8b2bc39805ef1e904c61c6ec0e7952ce0512d
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 17, 2026.

Transparency log

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

Download URL pg0_embedded-0.17.0-py3-none-macosx_14_0_arm64.whl
Size 16.1 MB
Tags Python 3 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
76a09237210ed09e78e9a1234ec04ac9ae0441c2c6779d63b958cff8d698e675
BLAKE2b-256 checksum
How to use checksums
df9fedd81db64dfdc218f2a4de9ce8a5ede443edc7e25501cbc4f73673cba359
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 17, 2026.

Transparency log

Security for pg0-embedded 0.17.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.17.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 17, 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