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@localhost: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@localhost:5432/postgres

# Or using info()
info = pg.info()
print(info.uri)  # postgresql://postgres:postgres@localhost: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.12.2.tar.gz (18.4 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.12.2-py3-none-win_amd64.whl (55.0 MB view details)

Uploaded Python 3Windows x86-64

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

Uploaded Python 3manylinux: glibc 2.35+ x86-64

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

Uploaded Python 3manylinux: glibc 2.35+ ARM64

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

Uploaded Python 3macOS 15.0+ x86-64

pg0_embedded-0.12.2-py3-none-macosx_14_0_arm64.whl (13.0 MB view details)

Uploaded Python 3macOS 14.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for pg0_embedded-0.12.2.tar.gz
Algorithm Hash digest
SHA256 7a35d79fa5be250c47cc6c32a40b17536cb2435336e36cc81d9132523234e66f
MD5 3fe44ab8c80ba4cacbfeb0e0c95b0bfb
BLAKE2b-256 7e78fc34914b2005c9e2102c8958bfb73dc1f4962702a647b7b797902ed9bcd3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pg0_embedded-0.12.2-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 15a807e0b5f41f0e3a4d2f7d7e5d334e4078cb94a9635035083e28fca5cdded8
MD5 42d38c9c929013cebb774715e261b49a
BLAKE2b-256 337a843ef38f403f61da659d5bd0c16268ca91e36b8e6a242ad42271b5c0291c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pg0_embedded-0.12.2-py3-none-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 1b180fa0ae3f2f2344c33291a49d9b63f6d292f2c25ac239c69f9ef6d902fb43
MD5 fa05cc6dadbd47903680d138c81c0ea1
BLAKE2b-256 39dd1484c0bc71839cbba48da5f93c218feba3e4abae7f5323975c4a6d9cd9a9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pg0_embedded-0.12.2-py3-none-manylinux_2_35_aarch64.whl
Algorithm Hash digest
SHA256 6cb8e97834f4c4a1cefe6d11410cbbb4f864fe598f9aa54ed26853a7f3bc1897
MD5 ff727eff17d1055415b3dc43555fe4b4
BLAKE2b-256 4d7b406f6a6244a9958529e6c6575c20e23c43a1e1afc05c71238da12e847028

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pg0_embedded-0.12.2-py3-none-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 f56f75d31959dcc33f8ef915d04417e54f6280aa1bd2d40077c1e4da8f0f4347
MD5 9421cb553453baff28d726a0a537b4dc
BLAKE2b-256 d030d39667ba551d0c68ec00b19bcc3e836f1a0b038d9e2e56f969556ebe8780

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pg0_embedded-0.12.2-py3-none-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 09cfdb02e35ad966f4ee8b108956dcf159f217ced022640efb9b661b8c9b453d
MD5 4fe749f45ae17c9a0f6b1f1401abd255
BLAKE2b-256 bb624940bb2c760a2d723dd66a0ad6d75083978e615c51753565a0ead3a4746d

See more details on using hashes here.

Provenance

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