Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

kerno

Python bindings for Kerno: an embedded database of units (typed records), the relations between them, and queries over both. It runs inside your process and keeps its data in a directory on disk; there is no server.

Status: alpha, not yet published on PyPI. Build it from source as shown below.

Five-minute quickstart

Install (from a checkout of the repository, with a Rust toolchain):

cd bindings/python
python3 -m venv .venv && . .venv/bin/activate
pip install maturin
maturin develop --release

Open a database, store two units, relate them, read and query:

import kerno

with kerno.open("./memory-db") as db:                # creates the directory if needed
    note = db.store("note", "Rust has no GC")        # (unit_type, payload) -> id
    topic = db.store("topic", b"memory")             # str is stored as UTF-8, bytes as they are

    unit = db.read(note)                             # Unit, or None for an unknown id
    print(unit.unit_type, unit.payload)              # note b'Rust has no GC'

    db.relate(note, topic, "about")                  # (from, to, relation_type) -> relation id
    for edge in db.related(note):                    # outgoing by default
        print(edge.from_id, "->", edge.to_id, edge.relation_type)
    print(len(db.related(topic, direction="in")))    # 1: who points at the topic

    print([u.id for u in db.query("note")])          # every active unit of a type

Leaving the with block closes the database; without it, call db.close(). Data written before a close is there the next time you kerno.open the same path.

API

Call Returns
kerno.open(path) a Database; path is a str or os.PathLike
db.store(unit_type, payload) the new unit's id (32 hex digits)
db.read(id) Unit (id, unit_type, schema_version, lifecycle, revision, payload) or None
db.relate(from_id, to_id, relation_type) the relation's id
db.related(id, direction="out", relation_type=None) list[Relation] (id, from_id, to_id, relation_type)
db.query(unit_type=None, schema_version=None) list[Unit], every active unit that matches, in id order
db.close() None; closing twice is harmless

Errors: engine failures (invalid unit type, unknown unit in relate, a directory already held by another handle) raise kerno.KernoError; a malformed id or direction raises ValueError; using a closed database raises ValueError. Type stubs ship with the package (py.typed).

One process holds a database directory at a time. Calls release the GIL while they touch disk, and a Database can be shared between threads.

Durability

kerno.open asks for synchronous commits. That guarantee is verified on Linux (ext4, xfs) only; on other platforms the bindings still open the database, without that verification.

Development

cd bindings/python
python3 -m venv .venv && . .venv/bin/activate
pip install maturin pytest
maturin develop
pytest

The crate is excluded from the cargo workspace (it carries its own Cargo.lock and is built by maturin); check it on its own with cargo clippy --all-targets -- -D warnings.

Metadata

Release files for kernodb 1.0.0a1

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

Source distribution (sdist)

Source distribution for kernodb 1.0.0a1
File Size Uploaded Provenance Actions
kernodb-1.0.0a1.tar.gz 1.3 MB With provenance Details for kernodb-1.0.0a1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for kernodb 1.0.0a1
File Actions
kernodb-1.0.0a1-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details for kernodb-1.0.0a1-cp39-abi3-win_amd64.whl
kernodb-1.0.0a1-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details for kernodb-1.0.0a1-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
kernodb-1.0.0a1-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details for kernodb-1.0.0a1-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
kernodb-1.0.0a1-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details for kernodb-1.0.0a1-cp39-abi3-macosx_11_0_arm64.whl
kernodb-1.0.0a1-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details for kernodb-1.0.0a1-cp39-abi3-macosx_10_12_x86_64.whl

Total release size: 5.7 MB

Release files / kernodb-1.0.0a1.tar.gz

Download URL kernodb-1.0.0a1.tar.gz
Size 1.3 MB
Tags Source
SHA-256 checksum
How to use checksums
9ca2b563e5900ad10ce22758c2454e6501837e6fe7156231362de26bb98801d8
BLAKE2b-256 checksum
How to use checksums
989a2be755c7f4dacb1a61530dcb8ca7e16a8c2b0524abef344d7b5e542536a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 20, 2026.

Transparency log

Release files / kernodb-1.0.0a1-cp39-abi3-win_amd64.whl

Download URL kernodb-1.0.0a1-cp39-abi3-win_amd64.whl
Size 749.0 kB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
61f5170907f5c5d3c6984183c33865700f70ab3b2dc8f750ac9c1997dc39dc80
BLAKE2b-256 checksum
How to use checksums
aeb755e6be90c2e56f097cb75d071952c200c885f86169f92312d00828ae5ccd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 20, 2026.

Transparency log

Release files / kernodb-1.0.0a1-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL kernodb-1.0.0a1-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 975.1 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
b607964924be7200a1161b6b36cfca0ec3ba315f03d9e360e63f1b9fd95ff05b
BLAKE2b-256 checksum
How to use checksums
0b1ffd617c96be916fca20f3f582172c19bc415e708893a071ed305b6d9c8d9d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 20, 2026.

Transparency log

Release files / kernodb-1.0.0a1-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL kernodb-1.0.0a1-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 930.3 kB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
88c47977795bc1ee139b58b1d40eac859546386bf22d657b826b2f9db8aa6838
BLAKE2b-256 checksum
How to use checksums
eeea321c7ebaf9085c6d7c0ce16b1c666d971aa133b66dff6383171c2ea5c25e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 20, 2026.

Transparency log

Release files / kernodb-1.0.0a1-cp39-abi3-macosx_11_0_arm64.whl

Download URL kernodb-1.0.0a1-cp39-abi3-macosx_11_0_arm64.whl
Size 835.5 kB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
6965d8730412a25e8c26dcab268b5e546675e0844099138b3da67545bbfb0ccf
BLAKE2b-256 checksum
How to use checksums
849637ca4066ed07565dfaeeb24d231f598e3bb874951f01486d8ba79f75a06a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 20, 2026.

Transparency log

Release files / kernodb-1.0.0a1-cp39-abi3-macosx_10_12_x86_64.whl

Download URL kernodb-1.0.0a1-cp39-abi3-macosx_10_12_x86_64.whl
Size 879.5 kB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
157462b4365aea5b517347dcf1f0ec5939f1ca4e346a837091f8f7b96d574c99
BLAKE2b-256 checksum
How to use checksums
1fabe3fc643cd791e4a5c3ad43b3db0847747c37f3008f1652c95c8bdab36cd1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 20, 2026.

Transparency log

Security for kernodb 1.0.0a1

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 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for kernodb-1.0.0a1.tar.gz

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 Nov 20, 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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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