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

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

Uploaded Python 3Windows x86-64

pg0_embedded-0.14.1-py3-none-manylinux_2_35_x86_64.whl (29.9 MB view details)

Uploaded Python 3manylinux: glibc 2.35+ x86-64

pg0_embedded-0.14.1-py3-none-manylinux_2_35_aarch64.whl (29.4 MB view details)

Uploaded Python 3manylinux: glibc 2.35+ ARM64

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

Uploaded Python 3macOS 15.0+ x86-64

pg0_embedded-0.14.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.14.1.tar.gz.

File metadata

  • Download URL: pg0_embedded-0.14.1.tar.gz
  • Upload date:
  • Size: 19.2 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.14.1.tar.gz
Algorithm Hash digest
SHA256 aacdc4dbcb1cfae7c3f9eb94bc861d01ab3e2cbe46c9f22679681c4c474ed4d4
MD5 4ff744eba43b441a93448df4dce6da88
BLAKE2b-256 32ade53f65a23badfdca17274d0cc8fbf72f13fa8e80b848b1b37338b18c9c64

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pg0_embedded-0.14.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 d16df6e5bacee0d17feb140b6cfcb1db5d02a5ea3bdcbfd767033f633e6a2bef
MD5 21dc58765cfcbb7c945513cd41471289
BLAKE2b-256 091230defd807f52321df7aeec53dee309e73fa29ef465c5e7b5e79b5f4721f8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pg0_embedded-0.14.1-py3-none-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 f87acd4f9a2d63cbd06a4096a9e6cfbbfa03f0b84033225c4b75e68578069c2c
MD5 8a150010acefe42543d98194fb7837bb
BLAKE2b-256 2cc769a7fc9539dedc8e9595dc842947eaf4937100482f781b5808ab8c207aab

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pg0_embedded-0.14.1-py3-none-manylinux_2_35_aarch64.whl
Algorithm Hash digest
SHA256 aa69602443bc11ec09965415c65a9bf7195471b2821b6e96b1e47b95f9227690
MD5 be3cd73e4715033f347cf33f36a01f65
BLAKE2b-256 f4d839b52e8bd71941552aa7feac64d4270011327540f9d4ae26bb618be6fc23

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pg0_embedded-0.14.1-py3-none-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 f0431c7eba51f717ebb8ddde480764328a0865076d6d9308d95deb313f56202f
MD5 7a7072b1af805d145a9899ee216792a7
BLAKE2b-256 af84a6ccfb05e0763eac342c062a41b36ee6918d11dcbfbac8d6e085ba54bc72

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pg0_embedded-0.14.1-py3-none-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 0f8d727702306204eb97f3ba4bfd75e93ec6ee9c8f8474c5cd51899921ae28a4
MD5 610b5cd6a912ce3c9f1d45590c7c2a8f
BLAKE2b-256 2dd972acd7b4fd89e5dd06907936924a13bc658399447de4ade296306d55cd41

See more details on using hashes here.

Provenance

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