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

Uploaded Python 3Windows x86-64

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

Uploaded Python 3manylinux: glibc 2.35+ x86-64

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

Uploaded Python 3manylinux: glibc 2.35+ ARM64

pg0_embedded-0.10.1-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.10.1.tar.gz.

File metadata

  • Download URL: pg0_embedded-0.10.1.tar.gz
  • Upload date:
  • Size: 17.6 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.10.1.tar.gz
Algorithm Hash digest
SHA256 afbfa9e050bec48587d55410e2a93694390c8fb50e1bbab2ac22a36a7eec146d
MD5 e468c131613e79a1c0f8209e8bf3d378
BLAKE2b-256 5d2a26aed143a5bc4396321c5016c3e7574d596b94122e4de555ec21ebd1f135

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pg0_embedded-0.10.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 39516c952edc050fbb9e24c35d28c9e013f108879b9c8e91091325231cbdb5a1
MD5 ef567e92faef0f92945ad7fc72d129a2
BLAKE2b-256 d0a864963aef0d6ae720b88068441ebdede95b727218c26927e0b8c17d91cf2f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pg0_embedded-0.10.1-py3-none-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 f2ae4ed1ce0aa42a310f20b1ea47dd6091f0f74106b7ded39e9c089e7f80ab25
MD5 e4e6a3913b934681fd28aa79ffc32bdc
BLAKE2b-256 7b25a2f84a1c142b48c2a41f14765721650076e2be56762b5ad7cd72ae32e5e4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pg0_embedded-0.10.1-py3-none-manylinux_2_35_aarch64.whl
Algorithm Hash digest
SHA256 b6f2fc089e844a67dbc1b16899f582ca857744bdd7842b4166a6eecce807a5af
MD5 3f6e8f1642d2050db32a7d443b8227ee
BLAKE2b-256 7203d6e64310c59da880cda4931216f328f72a014c19722fa754b1a0d6422cbb

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pg0_embedded-0.10.1-py3-none-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 913010ad1a2321367f47cdc907a1639537af36597cd9b61549a341d8da3f249b
MD5 c3fd9eb898febd6f1c4af1dd5bb90be7
BLAKE2b-256 086103f089d9d812e782db200f330e7cf35903834d7f106a2d650bb92c73c8d7

See more details on using hashes here.

Provenance

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