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

Built distributions (wheels)

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

Total release size: 194.7 MB

Release files / pg0_embedded-0.18.1.tar.gz

Download URL pg0_embedded-0.18.1.tar.gz
Size 22.2 kB
Tags Source
SHA-256 checksum
How to use checksums
109b75220f4b76cacef33bb1cc2bc5ead1a7fe48551ddcdbc166fd0e4b4f66e9
BLAKE2b-256 checksum
How to use checksums
f0d49589bcf60494723df62d33ab1ec50ae950decb7543a83d743820ee75831d
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.1-py3-none-win_amd64.whl

Download URL pg0_embedded-0.18.1-py3-none-win_amd64.whl
Size 52.3 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
6904c02794313bfd7b82d6a4a0fecec3047b5df3c97e6417bcb10e2297720699
BLAKE2b-256 checksum
How to use checksums
e665b60adba106261c26130e0b099b3556a7753a04968783ab36bedb12ba785c
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.1-py3-none-manylinux_2_35_x86_64.whl

Download URL pg0_embedded-0.18.1-py3-none-manylinux_2_35_x86_64.whl
Size 37.9 MB
Tags Linux glibc 2.35+ x86-64 Python 3
SHA-256 checksum
How to use checksums
027fd841e47fccba2544c524a1acb3b1a204d50aa58986aec9154f1ad143e1d7
BLAKE2b-256 checksum
How to use checksums
18c081c5e3dd0ba1c7fb29f47182cbe8b24edb4473efe58da6eaad9e7819194d
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.1-py3-none-manylinux_2_35_aarch64.whl

Download URL pg0_embedded-0.18.1-py3-none-manylinux_2_35_aarch64.whl
Size 37.1 MB
Tags Linux glibc 2.35+ ARM64 Python 3
SHA-256 checksum
How to use checksums
7ea8e70e868d79d52a5f0f8fac5149ec1ef95a334b5ad5d2c70d3260f4506d3e
BLAKE2b-256 checksum
How to use checksums
8a1533bd816d89d186291b68a4097b8351a7d9c3ca23a2090254fa0a961d2f06
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.1-py3-none-macosx_15_0_x86_64.whl

Download URL pg0_embedded-0.18.1-py3-none-macosx_15_0_x86_64.whl
Size 34.0 MB
Tags Python 3 macOS 15.0+ x86-64
SHA-256 checksum
How to use checksums
66b89dfe49bad5a4e757d45081be9e3e0ff1311b0eed91fd3d27ecd811858de5
BLAKE2b-256 checksum
How to use checksums
59a6de6ea15b7ad17946d9a6125a645dae1404235974568d9e76a70fbe3eec96
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.1-py3-none-macosx_14_0_arm64.whl

Download URL pg0_embedded-0.18.1-py3-none-macosx_14_0_arm64.whl
Size 33.4 MB
Tags Python 3 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
d9a72fe77ea201fd2f25f47ee49bf9743ac28bd6c5c2632fb005fc9f08fc756b
BLAKE2b-256 checksum
How to use checksums
fcc96127464c483d4a476d2948be82d600653677c5d9a792153e98b654aeea0b
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.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.18.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 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