Python API for pg0 - embedded PostgreSQL
Project description
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
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pg0_embedded-0.14.1.tar.gz.
File metadata
- Download URL: pg0_embedded-0.14.1.tar.gz
- Upload date:
- Size: 19.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aacdc4dbcb1cfae7c3f9eb94bc861d01ab3e2cbe46c9f22679681c4c474ed4d4
|
|
| MD5 |
4ff744eba43b441a93448df4dce6da88
|
|
| BLAKE2b-256 |
32ade53f65a23badfdca17274d0cc8fbf72f13fa8e80b848b1b37338b18c9c64
|
Provenance
The following attestation bundles were made for pg0_embedded-0.14.1.tar.gz:
Publisher:
release-cli.yml on vectorize-io/pg0
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pg0_embedded-0.14.1.tar.gz -
Subject digest:
aacdc4dbcb1cfae7c3f9eb94bc861d01ab3e2cbe46c9f22679681c4c474ed4d4 - Sigstore transparency entry: 1472023286
- Sigstore integration time:
-
Permalink:
vectorize-io/pg0@acdb0df36bfa72cccf3ffd1f2a30f6ee9fb41b04 -
Branch / Tag:
refs/tags/v0.14.1 - Owner: https://github.com/vectorize-io
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-cli.yml@acdb0df36bfa72cccf3ffd1f2a30f6ee9fb41b04 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pg0_embedded-0.14.1-py3-none-win_amd64.whl.
File metadata
- Download URL: pg0_embedded-0.14.1-py3-none-win_amd64.whl
- Upload date:
- Size: 55.1 MB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d16df6e5bacee0d17feb140b6cfcb1db5d02a5ea3bdcbfd767033f633e6a2bef
|
|
| MD5 |
21dc58765cfcbb7c945513cd41471289
|
|
| BLAKE2b-256 |
091230defd807f52321df7aeec53dee309e73fa29ef465c5e7b5e79b5f4721f8
|
Provenance
The following attestation bundles were made for pg0_embedded-0.14.1-py3-none-win_amd64.whl:
Publisher:
release-cli.yml on vectorize-io/pg0
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pg0_embedded-0.14.1-py3-none-win_amd64.whl -
Subject digest:
d16df6e5bacee0d17feb140b6cfcb1db5d02a5ea3bdcbfd767033f633e6a2bef - Sigstore transparency entry: 1472026165
- Sigstore integration time:
-
Permalink:
vectorize-io/pg0@acdb0df36bfa72cccf3ffd1f2a30f6ee9fb41b04 -
Branch / Tag:
refs/tags/v0.14.1 - Owner: https://github.com/vectorize-io
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-cli.yml@acdb0df36bfa72cccf3ffd1f2a30f6ee9fb41b04 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pg0_embedded-0.14.1-py3-none-manylinux_2_35_x86_64.whl.
File metadata
- Download URL: pg0_embedded-0.14.1-py3-none-manylinux_2_35_x86_64.whl
- Upload date:
- Size: 29.9 MB
- Tags: Python 3, manylinux: glibc 2.35+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f87acd4f9a2d63cbd06a4096a9e6cfbbfa03f0b84033225c4b75e68578069c2c
|
|
| MD5 |
8a150010acefe42543d98194fb7837bb
|
|
| BLAKE2b-256 |
2cc769a7fc9539dedc8e9595dc842947eaf4937100482f781b5808ab8c207aab
|
Provenance
The following attestation bundles were made for pg0_embedded-0.14.1-py3-none-manylinux_2_35_x86_64.whl:
Publisher:
release-cli.yml on vectorize-io/pg0
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pg0_embedded-0.14.1-py3-none-manylinux_2_35_x86_64.whl -
Subject digest:
f87acd4f9a2d63cbd06a4096a9e6cfbbfa03f0b84033225c4b75e68578069c2c - Sigstore transparency entry: 1472024520
- Sigstore integration time:
-
Permalink:
vectorize-io/pg0@acdb0df36bfa72cccf3ffd1f2a30f6ee9fb41b04 -
Branch / Tag:
refs/tags/v0.14.1 - Owner: https://github.com/vectorize-io
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-cli.yml@acdb0df36bfa72cccf3ffd1f2a30f6ee9fb41b04 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pg0_embedded-0.14.1-py3-none-manylinux_2_35_aarch64.whl.
File metadata
- Download URL: pg0_embedded-0.14.1-py3-none-manylinux_2_35_aarch64.whl
- Upload date:
- Size: 29.4 MB
- Tags: Python 3, manylinux: glibc 2.35+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aa69602443bc11ec09965415c65a9bf7195471b2821b6e96b1e47b95f9227690
|
|
| MD5 |
be3cd73e4715033f347cf33f36a01f65
|
|
| BLAKE2b-256 |
f4d839b52e8bd71941552aa7feac64d4270011327540f9d4ae26bb618be6fc23
|
Provenance
The following attestation bundles were made for pg0_embedded-0.14.1-py3-none-manylinux_2_35_aarch64.whl:
Publisher:
release-cli.yml on vectorize-io/pg0
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pg0_embedded-0.14.1-py3-none-manylinux_2_35_aarch64.whl -
Subject digest:
aa69602443bc11ec09965415c65a9bf7195471b2821b6e96b1e47b95f9227690 - Sigstore transparency entry: 1472025602
- Sigstore integration time:
-
Permalink:
vectorize-io/pg0@acdb0df36bfa72cccf3ffd1f2a30f6ee9fb41b04 -
Branch / Tag:
refs/tags/v0.14.1 - Owner: https://github.com/vectorize-io
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-cli.yml@acdb0df36bfa72cccf3ffd1f2a30f6ee9fb41b04 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pg0_embedded-0.14.1-py3-none-macosx_15_0_x86_64.whl.
File metadata
- Download URL: pg0_embedded-0.14.1-py3-none-macosx_15_0_x86_64.whl
- Upload date:
- Size: 13.7 MB
- Tags: Python 3, macOS 15.0+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f0431c7eba51f717ebb8ddde480764328a0865076d6d9308d95deb313f56202f
|
|
| MD5 |
7a7072b1af805d145a9899ee216792a7
|
|
| BLAKE2b-256 |
af84a6ccfb05e0763eac342c062a41b36ee6918d11dcbfbac8d6e085ba54bc72
|
Provenance
The following attestation bundles were made for pg0_embedded-0.14.1-py3-none-macosx_15_0_x86_64.whl:
Publisher:
release-cli.yml on vectorize-io/pg0
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pg0_embedded-0.14.1-py3-none-macosx_15_0_x86_64.whl -
Subject digest:
f0431c7eba51f717ebb8ddde480764328a0865076d6d9308d95deb313f56202f - Sigstore transparency entry: 1472024381
- Sigstore integration time:
-
Permalink:
vectorize-io/pg0@acdb0df36bfa72cccf3ffd1f2a30f6ee9fb41b04 -
Branch / Tag:
refs/tags/v0.14.1 - Owner: https://github.com/vectorize-io
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-cli.yml@acdb0df36bfa72cccf3ffd1f2a30f6ee9fb41b04 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pg0_embedded-0.14.1-py3-none-macosx_14_0_arm64.whl.
File metadata
- Download URL: pg0_embedded-0.14.1-py3-none-macosx_14_0_arm64.whl
- Upload date:
- Size: 13.1 MB
- Tags: Python 3, macOS 14.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0f8d727702306204eb97f3ba4bfd75e93ec6ee9c8f8474c5cd51899921ae28a4
|
|
| MD5 |
610b5cd6a912ce3c9f1d45590c7c2a8f
|
|
| BLAKE2b-256 |
2dd972acd7b4fd89e5dd06907936924a13bc658399447de4ade296306d55cd41
|
Provenance
The following attestation bundles were made for pg0_embedded-0.14.1-py3-none-macosx_14_0_arm64.whl:
Publisher:
release-cli.yml on vectorize-io/pg0
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pg0_embedded-0.14.1-py3-none-macosx_14_0_arm64.whl -
Subject digest:
0f8d727702306204eb97f3ba4bfd75e93ec6ee9c8f8474c5cd51899921ae28a4 - Sigstore transparency entry: 1472025806
- Sigstore integration time:
-
Permalink:
vectorize-io/pg0@acdb0df36bfa72cccf3ffd1f2a30f6ee9fb41b04 -
Branch / Tag:
refs/tags/v0.14.1 - Owner: https://github.com/vectorize-io
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-cli.yml@acdb0df36bfa72cccf3ffd1f2a30f6ee9fb41b04 -
Trigger Event:
push
-
Statement type: