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

Uploaded Python 3Windows x86-64

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

Uploaded Python 3manylinux: glibc 2.35+ ARM64

pg0_embedded-0.11.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.11.1.tar.gz.

File metadata

  • Download URL: pg0_embedded-0.11.1.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.11.1.tar.gz
Algorithm Hash digest
SHA256 864622e9ff3e476eedd00f8d3c69ac66392d98c746f8b269d57fb0d525ed977d
MD5 42230a2aaa62cbb7f9626a85c9a04a50
BLAKE2b-256 a74e724cfb7504a0e6ce1af56100c88a2e19c63facad5cf5e7490a63052e002a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pg0_embedded-0.11.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 515c581918b74db988c1003fbf642b8c05e04820b37557c0c2d6484231a3cb6f
MD5 2c5a44afce249a9fddc2c641f52c6713
BLAKE2b-256 4fe8320b53a6b5fa2f4fb740a65054d27977512322f776961fb51ca9d5fc57c9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pg0_embedded-0.11.1-py3-none-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 d48a7eb4b5f187ee6e9c9be0973cdcacb1ad244c287ad0ad85c7aee9614099e8
MD5 4f244836800d3bba7e2aa1b955f05ca5
BLAKE2b-256 9398e42abaa832e137bfa0679cc4c97a1f064410a1b8a54538fb5b20b74069b3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pg0_embedded-0.11.1-py3-none-manylinux_2_35_aarch64.whl
Algorithm Hash digest
SHA256 bae00714497e55b3eb37ab0b5a251b8c15de1520b96570484ff931fd214fac2e
MD5 ed5e19e6a66c467511672982757a78d1
BLAKE2b-256 7d6c4683b5dd0b61d4a2477f76718933cd54454811e5055c67977b2ab9986e2c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pg0_embedded-0.11.1-py3-none-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 8a0e3599a58b486af2252b8fd30506adc11e5d5d619aa46e816e2f22aea45fc8
MD5 5309178e111c8d60e19c56c22b0f8c85
BLAKE2b-256 831e304f9083acead15bfca4b1fa550979bf0ae571456d7d0585c30a7c7cf9d7

See more details on using hashes here.

Provenance

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