Skip to main content

PicoVolt for Python

Python bindings for the PicoVolt embedded database engine, via its C ABI and ctypes. Released platform wheels bundle the native library, so installing from PyPI does not require a Rust or C compiler.

Like the engine itself, this is for embedded use (single writer, SQL with MVCC time-travel, compile-to-.pvdb), not a drop-in for a concurrent server's primary database.

Install

Platform wheels bundle the native library, so released builds install without a Rust compiler. The compatibility floor is Python 3.9, but production deployments should use a Python release that still receives upstream security fixes:

python -m pip install picovolt

Build the shared library from the repository root:

cargo build --release --features capi

That produces target/release/libpicovolt.so (Linux), target/release/libpicovolt.dylib (macOS), or target/release/picovolt.dll (Windows). When you run from a checkout, the wrapper finds it in target/release automatically. Otherwise set PICOVOLT_LIB to the file:

export PICOVOLT_LIB=/path/to/libpicovolt.so

Usage

from picovolt import Database

with Database.open_memory() as db:
    db.query("CREATE TABLE users (id, name)")
    db.query("INSERT INTO users VALUES (1, 'alice')")
    print(db.query("SELECT * FROM users"))
    # {'columns': ['id', 'name'], 'rows': [[1, 'alice']]}

query returns the already-parsed result (a dict): {"columns": [...], "rows": [[...]]} for a SELECT, {"mutated": n} for a mutation, or {"done": True} otherwise. Other methods: open_dev, open_prod, from_bytes, export, begin, commit, rollback, in_transaction, current_tx, and the module-level version(). A PEP 249 adapter is available as picovolt.dbapi2.

For SQL executed repeatedly, prepare it once. The wrapper caches the SQL text and positional-parameter count, validates arity before each execution, and passes values through the same injection-safe binder as query:

with db.prepare("INSERT INTO users VALUES (?, ?)") as insert:
    print(insert.parameter_count)  # 2
    insert.execute((1, "Ada"))
    insert.execute((2, "Lin"))

Preparation validates SQL and retains a native statement handle. Close the statement (or use its context manager) before closing the database. A statement does not own or close its database, and executing it after either handle has been closed raises PicoVoltError.

Run the demo:

python example.py

Release wheels are built for Linux x86-64, macOS universal2, and Windows x86-64 by GitHub Actions. Source checkouts and other architectures can instead use PICOVOLT_LIB to select a locally built library.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

picovolt-1.7.1-py3-none-win_amd64.whl (550.3 kB view details)

Uploaded Python 3Windows x86-64

picovolt-1.7.1-py3-none-manylinux_2_28_x86_64.whl (709.4 kB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

picovolt-1.7.1-py3-none-macosx_10_9_universal2.whl (1.2 MB view details)

Uploaded Python 3macOS 10.9+ universal2 (ARM64, x86-64)

File details

Details for the file picovolt-1.7.1-py3-none-win_amd64.whl.

File metadata

  • Download URL: picovolt-1.7.1-py3-none-win_amd64.whl
  • Upload date:
  • Size: 550.3 kB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for picovolt-1.7.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 75ccde5d72bce62c4124f15f919c989be07c210be4bf6eb6e4e6dbeeeff338ab
MD5 e5d67b567f04880d3a64816a9ffa6689
BLAKE2b-256 b5aaa79212227d3800bdd5a9f4969bf3891b194f1d686cb6780a6b543fd55de9

See more details on using hashes here.

Provenance

The following attestation bundles were made for picovolt-1.7.1-py3-none-win_amd64.whl:

Publisher: python-wheels.yml on MiniJe/picovolt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file picovolt-1.7.1-py3-none-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for picovolt-1.7.1-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 169529d70df115540e6bf82511e8a4653e283c07baa9ac5cc8af50bf89766b3d
MD5 f33c2fd7af29d5769dc5ce8a6a8ea99e
BLAKE2b-256 56678992ec59a0afe2dbabcbf59fe2ac989cd1cfee9a312eb0866051e7e593a5

See more details on using hashes here.

Provenance

The following attestation bundles were made for picovolt-1.7.1-py3-none-manylinux_2_28_x86_64.whl:

Publisher: python-wheels.yml on MiniJe/picovolt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file picovolt-1.7.1-py3-none-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for picovolt-1.7.1-py3-none-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 c6a04ab0783289f8f9aa1cd24d26f7f8cb6f3f13a34581eed9269a5fea185563
MD5 1820a8f1a7f337db5fd1ef20ffbecb43
BLAKE2b-256 d84ec235b18576bfffad6407f0e36b402e42ebc8b6d6c9ba3ba007651a35deca

See more details on using hashes here.

Provenance

The following attestation bundles were made for picovolt-1.7.1-py3-none-macosx_10_9_universal2.whl:

Publisher: python-wheels.yml on MiniJe/picovolt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

1.8.1

3 files

1.8.0

3 files

This release

1.7.1 This release

3 files

1.7.0

3 files

1.6.0

3 files

1.5.0

3 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page