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

Uploaded Python 3Windows x86-64

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

Uploaded Python 3manylinux: glibc 2.35+ ARM64

pg0_embedded-0.11.0-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.11.0.tar.gz.

File metadata

  • Download URL: pg0_embedded-0.11.0.tar.gz
  • Upload date:
  • Size: 17.7 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.11.0.tar.gz
Algorithm Hash digest
SHA256 f086e1980e142fddf540b9eabef156ffab432b41a2673e5e1e0c2fb97b83bfba
MD5 27be2a33f5e3b602a464f46fc7cabe19
BLAKE2b-256 ad6ced900aeea802f6217d6979a16084903fb454d3d149b3f4dbe7ff019407db

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pg0_embedded-0.11.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 b67639f4dd280936492c3ba409dff1ace6911ecad9f4a5a4139d11e4fd0dd913
MD5 2f665401d307568be4be804e4a7e9778
BLAKE2b-256 123c81b7f01a2d008c0b842919ffbfab3bd582c55fed060ff07ef39a9a027742

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pg0_embedded-0.11.0-py3-none-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 c93871b38f0ae2e69e3ce1d58f3f30c5245e2b40b2dc8b9bf367e5942492f041
MD5 4a03cc7dd324d010d948ad3a02657944
BLAKE2b-256 9ecbf7f023942957f98e89e6d170bfe6fdeee92c4df6c93ba57b7d301b4c5226

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pg0_embedded-0.11.0-py3-none-manylinux_2_35_aarch64.whl
Algorithm Hash digest
SHA256 cdb68aadb47938bc7e4cf3794ddcd36f3278a26aa2863ea6008288658b7d545a
MD5 a963e70c48df2afb48424e46563224e2
BLAKE2b-256 e688444f74d883c6838420dc26f833146c4acd2bf52f029a41c66e7107fc94d8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pg0_embedded-0.11.0-py3-none-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 4fb4a6ba596d84b19bebfcd1ccff0a531b6b716cf57209e1a016b3cbf1c04454
MD5 5307476ee479f99546b2753a619bc835
BLAKE2b-256 6507ee9cd32ec3a81c1fca01a83dcd8e92ff98dd5b21e9c3bee85d688ec18be2

See more details on using hashes here.

Provenance

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