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.16.1

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

Built distributions (wheels)

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

Total release size: 147.5 MB

Release files / pg0_embedded-0.16.1.tar.gz

Download URL pg0_embedded-0.16.1.tar.gz
Size 22.2 kB
Tags Source
SHA-256 checksum
How to use checksums
169e27f66e03b29cbea95d0920d598f7ea7edd5c28913d2a6ae756871b55cb82
BLAKE2b-256 checksum
How to use checksums
c90411ead62e4a8da2e9804459a0ffaced4bb506d09ada7accc4530a8a590136
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 4, 2026.

Transparency log

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

Download URL pg0_embedded-0.16.1-py3-none-win_amd64.whl
Size 55.1 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
54a282af0548cceb7c16774bcc8ba5af4dec1925eebad5c7214c31e77c3fefc1
BLAKE2b-256 checksum
How to use checksums
40d03c5a71b6a3673fffe2f84a771a2a9e890f8ac693086b140be971958c23f0
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 4, 2026.

Transparency log

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

Download URL pg0_embedded-0.16.1-py3-none-manylinux_2_35_x86_64.whl
Size 30.4 MB
Tags Linux glibc 2.35+ x86-64 Python 3
SHA-256 checksum
How to use checksums
56e78eb6717c4197d49b6c2d2c828d623d27c6874baafc6969764b6de28c873a
BLAKE2b-256 checksum
How to use checksums
40b1961aac259064ca8ebb46e2093a85785eb0d7ceaaa8e6b4bd4ef2185e2465
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 4, 2026.

Transparency log

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

Download URL pg0_embedded-0.16.1-py3-none-manylinux_2_35_aarch64.whl
Size 29.8 MB
Tags Linux glibc 2.35+ ARM64 Python 3
SHA-256 checksum
How to use checksums
23fc3db7f2b35ba1d459e25751dd51738960822a64454ae7d75cf650cc53d5b2
BLAKE2b-256 checksum
How to use checksums
02c7631ace99d95eae51ffed8e2d8ba3991700631ddf2dd8f45954289e26bcc6
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 4, 2026.

Transparency log

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

Download URL pg0_embedded-0.16.1-py3-none-macosx_15_0_x86_64.whl
Size 16.4 MB
Tags Python 3 macOS 15.0+ x86-64
SHA-256 checksum
How to use checksums
16d81d494acf609f7083dee4befb36543591dcd02731308e432f1e3446bbdd0b
BLAKE2b-256 checksum
How to use checksums
1005d39c950a6d28df76f74b47dd3b76fb1ef95d62864f449f5e5617c3996e2d
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 4, 2026.

Transparency log

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

Download URL pg0_embedded-0.16.1-py3-none-macosx_14_0_arm64.whl
Size 15.8 MB
Tags Python 3 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
a110c1b323517faa17a177776390c3fd2ffbc0598ae694e5d19ea87f19b4a158
BLAKE2b-256 checksum
How to use checksums
d0471a221037c0ba17ef33bfaa8f4d0243d0b51daa2125ab7636d50d733c1a17
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 4, 2026.

Transparency log

Security for pg0-embedded 0.16.1

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.16.1.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 4, 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