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.0.tar.gz (18.0 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.0-py3-none-win_amd64.whl (55.0 MB view details)

Uploaded Python 3Windows x86-64

pg0_embedded-0.12.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.12.0-py3-none-manylinux_2_35_aarch64.whl (14.7 MB view details)

Uploaded Python 3manylinux: glibc 2.35+ ARM64

pg0_embedded-0.12.0-py3-none-macosx_15_0_x86_64.whl (13.6 MB view details)

Uploaded Python 3macOS 15.0+ x86-64

pg0_embedded-0.12.0-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.0.tar.gz.

File metadata

  • Download URL: pg0_embedded-0.12.0.tar.gz
  • Upload date:
  • Size: 18.0 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.0.tar.gz
Algorithm Hash digest
SHA256 5a3f89758e0104a746ea30ccf8e67b8cf31bd9df47fc346c783ce066f317c127
MD5 036c9aded40420318a576fd3eda34927
BLAKE2b-256 a8b3d106f9fe649d8f031ca81bb7b5c2c3b78d1b610384351249c442ccda5af6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pg0_embedded-0.12.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 070b94b6be2e538539d46e87598a3bb9ba1c425693973898f4b8915bf06ab7bc
MD5 1dfff64539c9aae540bebaf8234a9ecc
BLAKE2b-256 b1eb2d06ab6e6a0fffad2ab82cce02a332332890540d3ab84b833120128d7739

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pg0_embedded-0.12.0-py3-none-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 f05c5d433d4d63abecd47961006c6ef686c66d67a52526ce65d9a229e8f2b044
MD5 7af46ac9d3c34878907cbe8b9d9e2534
BLAKE2b-256 77fc77126dead2f460e2dd1179feb094d8aa2c1bdd5264932c008723aa9377b9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pg0_embedded-0.12.0-py3-none-manylinux_2_35_aarch64.whl
Algorithm Hash digest
SHA256 517f53b098c32e8b4dcec84212d0167824fc5cfd682178c28e31c7c22d5ee07c
MD5 1515edb33bb899fc55931364d87777f7
BLAKE2b-256 bcbcde2a12e914b1d6954050c176197808fc07ad489c7d4bcb225c118889a5ed

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pg0_embedded-0.12.0-py3-none-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 ad7a95adb2574b7a111f5887f7729085f3c2d2490efc39835a9b8fa6ab156f96
MD5 eceec322c6a5a26624f8e2dfa3fd6df3
BLAKE2b-256 70cac10dff14d77806e842db8cf8d491191a32861e639ad462c6c361c133749b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pg0_embedded-0.12.0-py3-none-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 f97b2ac5dda00085176e176449a1c96dcd7229c2fae98be1b649d7ffcb07a4f3
MD5 1955e9c6f6915f0c51718db45ae28d17
BLAKE2b-256 78b5bb5170a26e09a7c5b61dfbd42be7df462af11d7357045fb07253c844c351

See more details on using hashes here.

Provenance

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