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.

Metadata

Release files for picovolt 1.9.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for picovolt 1.9.0
File Interpreter ABI Platform
picovolt-1.9.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
picovolt-1.9.0-py3-none-manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.28+ x86-64 Details
picovolt-1.9.0-py3-none-macosx_10_9_universal2.whl Python 3 none macOS 10.9+ universal2 (ARM64, x86-64) Details

Total release size: 2.6 MB

Release files / picovolt-1.9.0-py3-none-win_amd64.whl

Download URL picovolt-1.9.0-py3-none-win_amd64.whl
Size 593.5 kB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
5673e34fc55ac70fa0fa38936c2675619b6de87a20490dd4d60c862f8d5ce9cc
BLAKE2b-256 checksum
How to use checksums
625ef0af94b3bbfcfd109f75939ad4d8ce00c4048bea80de1a8e21de343500b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 7, 2026.

Transparency log

Release files / picovolt-1.9.0-py3-none-manylinux_2_28_x86_64.whl

Download URL picovolt-1.9.0-py3-none-manylinux_2_28_x86_64.whl
Size 753.2 kB
Tags Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
9f06cf9956c494b4ff6ca0a04b7b53934550abb7c9f10da76a68d6b2775be159
BLAKE2b-256 checksum
How to use checksums
0a3cd67048e05001f9e874ba194d8177dd0bf57c228586db8f8aa29a9b126ce7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 7, 2026.

Transparency log

Release files / picovolt-1.9.0-py3-none-macosx_10_9_universal2.whl

Download URL picovolt-1.9.0-py3-none-macosx_10_9_universal2.whl
Size 1.3 MB
Tags Python 3 macOS 10.9+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
6d62debfe8a8bc6b434f68d1f7c9505ffc5c294573baea094824cf19fb1ebf86
BLAKE2b-256 checksum
How to use checksums
3f76f904df136f4ae0bd9fcce1a4d16fd19a8587067b4c5f01ddc9b88cd859f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 7, 2026.

Transparency log

Security for picovolt 1.9.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 3 files in this release have been uploaded with provenance metadata.

Select from 3 files

Attestation for picovolt-1.9.0-py3-none-win_amd64.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 7, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

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