Skip to main content

PicoVolt for Python

For 2.0, see the interface quickstart for batching, persistence and diagnostics. Use matching 2.0 artifacts.

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 2.2.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 2.2.0
File Interpreter ABI Platform
picovolt-2.2.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
picovolt-2.2.0-py3-none-manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.28+ x86-64 Details
picovolt-2.2.0-py3-none-macosx_10_12_universal2.whl Python 3 none macOS 10.12+ universal2 (ARM64, x86-64) Details

Total release size: 6.0 MB

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

Download URL picovolt-2.2.0-py3-none-win_amd64.whl
Size 1.6 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
3f32562a8ec578e9a9ac18bff3c82c87ab485e2c7f1440675bdf2de7155294cd
BLAKE2b-256 checksum
How to use checksums
589617f0dba27af9fd2a2d5286be4ae97a63a587e28fa5ddd53e66086775d252
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 12, 2026.

Transparency log

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

Download URL picovolt-2.2.0-py3-none-manylinux_2_28_x86_64.whl
Size 1.8 MB
Tags Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
4835be473bda2ba5072edcfc1fd8710550f040b0718347242b1fd5d09a26d659
BLAKE2b-256 checksum
How to use checksums
1becd3845a6a9fc36c18df3eedeaa3c001ab699f19536fea7becb20ff24228b0
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 12, 2026.

Transparency log

Release files / picovolt-2.2.0-py3-none-macosx_10_12_universal2.whl

Download URL picovolt-2.2.0-py3-none-macosx_10_12_universal2.whl
Size 2.6 MB
Tags Python 3 macOS 10.12+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
9f1adf6753223bec5febdf80d30890e522042d444786032562bfaf3a979ac607
BLAKE2b-256 checksum
How to use checksums
b4095832a94c51cf4a9dac3a452b7b82875e4591e2c57ac09d24fa411113c10a
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 12, 2026.

Transparency log

Security for picovolt 2.2.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-2.2.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 12, 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