Skip to main content

Python Package

primadb-python is the native Python package. It wraps the Rust runtime through PyO3 and is now documented around a uv-first workflow.

Source:

Full API reference:

Install

cd /home/bitnom/Code/gunport/primadb/packages/primadb-python
uv sync

Example

from primadb import Primadb

db = Primadb("py-a")
db.open_durable_storage(
{
"kind": "segment_files",
"directory": "/tmp/primadb-python-demo",
}
)

db.set_network_hooks(
{
"on_pull": lambda context: "private root denied"
if context["request"]["kind"] == "get"
and context["request"]["path"]["anchor"] == "private"
else None
}
)

Package Examples