Skip to main content

Python API for pg0 - embedded PostgreSQL

Project description

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

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pg0_embedded-0.13.0.tar.gz (18.9 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pg0_embedded-0.13.0-py3-none-win_amd64.whl (55.1 MB view details)

Uploaded Python 3Windows x86-64

pg0_embedded-0.13.0-py3-none-manylinux_2_35_x86_64.whl (15.2 MB view details)

Uploaded Python 3manylinux: glibc 2.35+ x86-64

pg0_embedded-0.13.0-py3-none-manylinux_2_35_aarch64.whl (14.8 MB view details)

Uploaded Python 3manylinux: glibc 2.35+ ARM64

pg0_embedded-0.13.0-py3-none-macosx_15_0_x86_64.whl (13.7 MB view details)

Uploaded Python 3macOS 15.0+ x86-64

pg0_embedded-0.13.0-py3-none-macosx_14_0_arm64.whl (13.1 MB view details)

Uploaded Python 3macOS 14.0+ ARM64

File details

Details for the file pg0_embedded-0.13.0.tar.gz.

File metadata

  • Download URL: pg0_embedded-0.13.0.tar.gz
  • Upload date:
  • Size: 18.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pg0_embedded-0.13.0.tar.gz
Algorithm Hash digest
SHA256 97e2a307ece3c7818ea35826b5b5b37f0bccb0da7beb7b55fff1d1491d56ce47
MD5 36e87219c461f8be8bf1fc32b15aa2bc
BLAKE2b-256 c97dd7cc2d94cac2b8b2b0fcf8c0d65c3c9fb831b13535426f6ecff7e8de8421

See more details on using hashes here.

Provenance

The following attestation bundles were made for pg0_embedded-0.13.0.tar.gz:

Publisher: release-cli.yml on vectorize-io/pg0

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pg0_embedded-0.13.0-py3-none-win_amd64.whl.

File metadata

  • Download URL: pg0_embedded-0.13.0-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

Hashes for pg0_embedded-0.13.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 1516cffab72c690b14fd4f34b8c512964ab2155983e0d077c0172d9624c4f6a8
MD5 0faf03027b24aa5f39a2fa7d078c4ae1
BLAKE2b-256 ef9eba10bba1ccb5282e76421a5c2956f3e9bd84e49f42090a0d17c0f92393e9

See more details on using hashes here.

Provenance

The following attestation bundles were made for pg0_embedded-0.13.0-py3-none-win_amd64.whl:

Publisher: release-cli.yml on vectorize-io/pg0

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pg0_embedded-0.13.0-py3-none-manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for pg0_embedded-0.13.0-py3-none-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 4696668167879ede13b315c958519de995a75e8e29e7d165a05eb4e8a90ac778
MD5 190e3c7bc921bcad06ed0d1224163340
BLAKE2b-256 961ce105461e96b8f975f54cf220d3d6aa00283085133ddad6b621aa47761262

See more details on using hashes here.

Provenance

The following attestation bundles were made for pg0_embedded-0.13.0-py3-none-manylinux_2_35_x86_64.whl:

Publisher: release-cli.yml on vectorize-io/pg0

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pg0_embedded-0.13.0-py3-none-manylinux_2_35_aarch64.whl.

File metadata

File hashes

Hashes for pg0_embedded-0.13.0-py3-none-manylinux_2_35_aarch64.whl
Algorithm Hash digest
SHA256 f88c3443ea30befd3715a38becac4f716e488eefdaccd97e15329aa0a771d276
MD5 9246298e016a64762a9079bea5f8ee56
BLAKE2b-256 e2a0916d9cc7cd0b0c36a3fe98d17ab582eabe8385fd015ac276c883a5c8c66b

See more details on using hashes here.

Provenance

The following attestation bundles were made for pg0_embedded-0.13.0-py3-none-manylinux_2_35_aarch64.whl:

Publisher: release-cli.yml on vectorize-io/pg0

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pg0_embedded-0.13.0-py3-none-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for pg0_embedded-0.13.0-py3-none-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 283ce9f5290d5c78cdc989697f52aa67d4ebf0a3b1b891058d5e7108d40a4e8b
MD5 00ee27d1de782bf6bb120dc02b4b47e2
BLAKE2b-256 50b33732e05c7f94e96eead3d85cbfb2bd148a57552427a99d5a91f2fabd80f6

See more details on using hashes here.

Provenance

The following attestation bundles were made for pg0_embedded-0.13.0-py3-none-macosx_15_0_x86_64.whl:

Publisher: release-cli.yml on vectorize-io/pg0

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pg0_embedded-0.13.0-py3-none-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for pg0_embedded-0.13.0-py3-none-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 ac7d3e0510719b4c3b9f7e7f5e947bc43cce1f90b4a6a4bbd369156514411e75
MD5 d3d5d38a39ee82c9e234062500f92c71
BLAKE2b-256 4922bb946457caba4eee037645adbf9586c791861afdbf77b620a9e31c2fc89b

See more details on using hashes here.

Provenance

The following attestation bundles were made for pg0_embedded-0.13.0-py3-none-macosx_14_0_arm64.whl:

Publisher: release-cli.yml on vectorize-io/pg0

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page