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.14.2.tar.gz (19.6 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.14.2-py3-none-win_amd64.whl (55.1 MB view details)

Uploaded Python 3Windows x86-64

pg0_embedded-0.14.2-py3-none-manylinux_2_35_x86_64.whl (29.9 MB view details)

Uploaded Python 3manylinux: glibc 2.35+ x86-64

pg0_embedded-0.14.2-py3-none-manylinux_2_35_aarch64.whl (29.4 MB view details)

Uploaded Python 3manylinux: glibc 2.35+ ARM64

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

Uploaded Python 3macOS 15.0+ x86-64

pg0_embedded-0.14.2-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.14.2.tar.gz.

File metadata

  • Download URL: pg0_embedded-0.14.2.tar.gz
  • Upload date:
  • Size: 19.6 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.14.2.tar.gz
Algorithm Hash digest
SHA256 e3534f6d014a6da230ef372307965fa0a9e8ae26e5882e1319645435cdcf2562
MD5 2d062cc61a9024662f77e79e6727a354
BLAKE2b-256 550183e47dbc41377a43c04313188c2442dfcda8520af94fa5c6d2af519e8eef

See more details on using hashes here.

Provenance

The following attestation bundles were made for pg0_embedded-0.14.2.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.14.2-py3-none-win_amd64.whl.

File metadata

  • Download URL: pg0_embedded-0.14.2-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.14.2-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 a0cd6e8f88fce1bb63b36ab0f851e613b397db023c7f0ec086b946b1f549a575
MD5 7946af47a6c3c2bc2a4305b65341190a
BLAKE2b-256 fc3f38868a6d42c8255d40754cdd86a90347c651f3fdc561ea4f766ff47b27d1

See more details on using hashes here.

Provenance

The following attestation bundles were made for pg0_embedded-0.14.2-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.14.2-py3-none-manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for pg0_embedded-0.14.2-py3-none-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 aef573a21b8b2b64f19162651097ec04df70f302b5042eb5ed7f23539053d1ca
MD5 2e3ec1db81de3b9ce63534bb2cddd33d
BLAKE2b-256 e0a2ee865726818fba05317b061892cf27241a8a4e98ecc05fd92b36e7d224f4

See more details on using hashes here.

Provenance

The following attestation bundles were made for pg0_embedded-0.14.2-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.14.2-py3-none-manylinux_2_35_aarch64.whl.

File metadata

File hashes

Hashes for pg0_embedded-0.14.2-py3-none-manylinux_2_35_aarch64.whl
Algorithm Hash digest
SHA256 f8dac4d2db5b8c2793c016cb8613a367f43a43a42253b5fd46e1bfac3397951c
MD5 38585a25296885aed99e805631bb26b3
BLAKE2b-256 c0273ce295cdcacaee32d0a66870b140e81460a20c3866cc3ef73fb0011ec6c4

See more details on using hashes here.

Provenance

The following attestation bundles were made for pg0_embedded-0.14.2-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.14.2-py3-none-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for pg0_embedded-0.14.2-py3-none-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 80bfd79075fdf3909134f2d3adf58ea202a95cd219f4081262e894757feec286
MD5 3384df93969b3b3e5006a319111ab0eb
BLAKE2b-256 d0373d4cc473631c4021d63dccd460c6cf1bb280eff74a47c54a723d09a812a9

See more details on using hashes here.

Provenance

The following attestation bundles were made for pg0_embedded-0.14.2-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.14.2-py3-none-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for pg0_embedded-0.14.2-py3-none-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 79c1ae875abc3ee4e4915a6178000e71b2df8073f47f861f882021c913759eb4
MD5 f976fac335c138f45ef76697d774ac13
BLAKE2b-256 db048abcc770b90d36703ac6ca6e212b71992a7428b836d41c1e860400967021

See more details on using hashes here.

Provenance

The following attestation bundles were made for pg0_embedded-0.14.2-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