pg0 - PostgreSQL for Python
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
Links
Metadata
Release files for pg0-embedded 0.16.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pg0_embedded-0.16.0.tar.gz | 22.2 kB | With provenance | Details for pg0_embedded-0.16.0.tar.gz |
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| pg0_embedded-0.16.0-py3-none-win_amd64.whl | Python 3 | none | Windows x86-64 | Details for pg0_embedded-0.16.0-py3-none-win_amd64.whl |
| pg0_embedded-0.16.0-py3-none-manylinux_2_35_x86_64.whl | Python 3 | none | Linux glibc 2.35+ x86-64 | Details for pg0_embedded-0.16.0-py3-none-manylinux_2_35_x86_64.whl |
| pg0_embedded-0.16.0-py3-none-manylinux_2_35_aarch64.whl | Python 3 | none | Linux glibc 2.35+ ARM64 | Details for pg0_embedded-0.16.0-py3-none-manylinux_2_35_aarch64.whl |
| pg0_embedded-0.16.0-py3-none-macosx_15_0_x86_64.whl | Python 3 | none | macOS 15.0+ x86-64 | Details for pg0_embedded-0.16.0-py3-none-macosx_15_0_x86_64.whl |
| pg0_embedded-0.16.0-py3-none-macosx_14_0_arm64.whl | Python 3 | none | macOS 14.0+ ARM64 | Details for pg0_embedded-0.16.0-py3-none-macosx_14_0_arm64.whl |
Total release size: 142.0 MB
Release files / pg0_embedded-0.16.0.tar.gz
| Download URL | pg0_embedded-0.16.0.tar.gz |
|---|---|
| Size | 22.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3120888f653246f092b659576c139269877479f55940245c9d91ec6b345c7649
|
|
BLAKE2b-256 checksum How to use checksums |
36eb6f57a7096cca37fd2112fc8a2535d024ea41189c70b90dcc0f5b9f001924
|
| 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 logRelease files / pg0_embedded-0.16.0-py3-none-win_amd64.whl
| Download URL | pg0_embedded-0.16.0-py3-none-win_amd64.whl |
|---|---|
| Size | 55.1 MB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
91e8fe84e8f9907d30459ed49f1aa2dd88595063b9f99358427baca75621bb5f
|
|
BLAKE2b-256 checksum How to use checksums |
9ab7fa8bcb767340b17cefb9fb3281d756654fa77a3cce5414c86323f8cfe8f5
|
| 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 logRelease files / pg0_embedded-0.16.0-py3-none-manylinux_2_35_x86_64.whl
| Download URL | pg0_embedded-0.16.0-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 |
23fbbbadabaf00686b7b6a08b481efb947c354ef5370e7866036582404d37e75
|
|
BLAKE2b-256 checksum How to use checksums |
f43bb95e44b3872032ba4f3cb37d17fddf1c1a8d83c5618b875d0dee18ba6f2f
|
| 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 logRelease files / pg0_embedded-0.16.0-py3-none-manylinux_2_35_aarch64.whl
| Download URL | pg0_embedded-0.16.0-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 |
a85723d5a1c65a4dbc5ac934f565db86e8cbf9df239d4e8154883ffd201d8cc4
|
|
BLAKE2b-256 checksum How to use checksums |
53428ebf4d05c737ef602b8cded273c58c3a6da2ea0dd378153d43dfeca1a19b
|
| 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 logRelease files / pg0_embedded-0.16.0-py3-none-macosx_15_0_x86_64.whl
| Download URL | pg0_embedded-0.16.0-py3-none-macosx_15_0_x86_64.whl |
|---|---|
| Size | 13.6 MB |
| Tags | Python 3 macOS 15.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
62e3b8f769ca7454e5b327527e37dd8c518de89382a7be35f514d8f1d19c0796
|
|
BLAKE2b-256 checksum How to use checksums |
da959797134ee27b1dd97a162857faac1bc4e851b0c07261f8293676e988a8da
|
| 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 logRelease files / pg0_embedded-0.16.0-py3-none-macosx_14_0_arm64.whl
| Download URL | pg0_embedded-0.16.0-py3-none-macosx_14_0_arm64.whl |
|---|---|
| Size | 13.0 MB |
| Tags | Python 3 macOS 14.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
10937b7b4e503397f090e76e7c7be257e57fefc84435e53561c84ec2bfc825e1
|
|
BLAKE2b-256 checksum How to use checksums |
3d825bd3229f98e23031c32b783294b56563bad40313abeac0e020cbb9d86901
|
| 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 logSecurity for pg0-embedded 0.16.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.
Attestation for pg0_embedded-0.16.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 4, 2026.
Transparency logA 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.