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.3.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.3-py3-none-win_amd64.whl (55.0 MB view details)

Uploaded Python 3Windows x86-64

pg0_embedded-0.12.3-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.3-py3-none-manylinux_2_35_aarch64.whl (14.8 MB view details)

Uploaded Python 3manylinux: glibc 2.35+ ARM64

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

Uploaded Python 3macOS 15.0+ x86-64

pg0_embedded-0.12.3-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.3.tar.gz.

File metadata

  • Download URL: pg0_embedded-0.12.3.tar.gz
  • Upload date:
  • Size: 18.4 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.12.3.tar.gz
Algorithm Hash digest
SHA256 09776dc4d85027bf3475dd30106d22e46a27324ccc9d451dfe4a10e61152d582
MD5 cb51adbd5365e68ec6ad3df64291054b
BLAKE2b-256 5d2ef9a90ac54e30e8052ecea563939679cfee7933e557a1197787a9b791b26e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pg0_embedded-0.12.3-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 912e6c64338a613befe627dc6679058cad80c093fe5b7e1867d52726c719083e
MD5 e2bfff1dd9b41dc1979836d52a5347ff
BLAKE2b-256 0117b37f87ef4c20ceb3ce7d191c7965b140e6857c92e760fa6b9c82427df603

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pg0_embedded-0.12.3-py3-none-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 4a18463a0fd0c0300a399022b283b14360344c4cf1a418c2f388389c5aba5eb0
MD5 9f460e39b360f639dd5d1b08cc3c2585
BLAKE2b-256 445c4c6e1621d7c5cc37485ed297181bab62371ab089b2e69ef8b5b147b17455

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pg0_embedded-0.12.3-py3-none-manylinux_2_35_aarch64.whl
Algorithm Hash digest
SHA256 7a93d2a36312cbe99b3d21ef99998077c5a296b14b6b6e3e8a6b33b33a15f729
MD5 b67f79c72b49fb6428c36b942132173a
BLAKE2b-256 0d9df253ae71b1de7b88a2399b49eaa4d28eab8b699d50d458b4ccfefc6a40ea

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pg0_embedded-0.12.3-py3-none-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 c4fa2c1f8d495a1ebc4e61ad6c73d46e784f2fd0c62d4d87302ef3c946b8a1ce
MD5 5ef1b81cf756a02f69edf9fb81133ad4
BLAKE2b-256 26c24226c37a3225c1e55428bd466cc2e08accfb59aa6659996858c4635f02ac

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pg0_embedded-0.12.3-py3-none-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 36ff6b58ff02fe974d77a5091f99410383094613ab90abee475ed6f39cbd10af
MD5 6d582f00d4893c25bde29348368641da
BLAKE2b-256 0d84c3d19ec4a6a4078a812ed97966784191f97887a39ebc055ef0d0602f6411

See more details on using hashes here.

Provenance

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