DirDB
Your directory is the database.
DirDB (pronounced Deer DB / Directory DB) is a filesystem-first local configuration store. Dir represents a directory; its reading also evokes deer and dear: a database close to your files.
The files in data/ are always the source of truth. SQLite holds rebuildable metadata and revision history, while callers get a small Python API backed by Rust.
from dirdb import DirDB
db = DirDB("./state")
version = db.set("services/auth/config", {"enabled": True})
config = db.get("services/auth/config")
The async API is the preferred path for application servers. It runs filesystem and SQLite work in a worker thread while the Rust extension releases the GIL.
import asyncio
from dirdb import DirDB
async def main() -> None:
db = DirDB("./state")
version = await db.aset("services/auth/config", {"enabled": True})
config = await db.aget("services/auth/config")
asyncio.run(main())
Status
DirDB is at the v0.2 local-reliability stage. It provides a bounded Rust cache, native file watching with a periodic integrity check, automatic repair of invalid external JSON edits, and sync/async batch APIs. Recovery plans, local IPC, and gRPC remain future milestones.
Layout
state/
├── data/ # authoritative JSON documents
│ └── services/auth/config.json
└── metadata.db # rebuildable catalog and revisions
Development
cargo test -p dirdb-core
uv run maturin develop
Install
python -m pip install DirDB-Rust
Build distributable artifacts with uv build. GitHub Actions builds and uploads wheels for Linux, macOS, and Windows on pull requests and version tags.
Git for Windows Bash
# Build a wheel for the default Python.
./scripts/build-wheel.sh
# Build and install the newest wheel into the default Python.
./scripts/build-and-install.sh
# Target a virtual environment or a specific Python installation.
PYTHON_BIN=/c/path/to/.venv/Scripts/python.exe ./scripts/build-and-install.sh
When launched in an interactive Git Bash window, each script keeps the window open and reports success or failure until Enter is pressed. Set NO_PAUSE=1 for automation.
Examples
Run the async Python example after installing the wheel:
python examples/python/async_basic.py
Run the Rust core example directly:
cargo run --manifest-path examples/rust/basic/Cargo.toml
See all examples.
Tests and Benchmarks
# Build/install DirDB first, then install the Python test dependency.
python -m pip install "pytest>=8"
python -m pytest tests/python -q
# Convenience alias; this delegates to pytest.
python -m tests tests/python -q
# Measure async read/write throughput.
python benchmark/python/async_throughput.py --items 1000 --concurrency 32
# Measure dictionary-style document round trips and warm-cache reads.
python benchmark/python/mapping_roundtrip.py --items 1000 --read-rounds 10
See benchmark notes.
CI and Releases
CI runs Rust formatting, Clippy, Rust tests, Ruff checks/formatting, wheel build/install tests with pytest, Python compilation checks, and platform wheel builds. A successful push to main automatically checks the package version against PyPI; if it is new, CI creates a GitHub Release and publishes the Linux, macOS, and Windows wheels plus the source distribution to PyPI through Trusted Publishing.
Documentation: English guides | Japanese guides | English design | 日本語設計書 | 日本語README
Implementation tracker: TODO | TODO (Japanese)
Metadata
Release files for DirDB-Rust 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| dirdb_rust-0.2.0.tar.gz | 20.2 kB | With provenance | Details |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dirdb_rust-0.2.0-cp311-cp311-win_amd64.whl | CPython 3.11 | CPython 3.11 | Windows x86-64 | Details |
| dirdb_rust-0.2.0-cp311-cp311-manylinux_2_34_x86_64.whl | CPython 3.11 | CPython 3.11 | Linux glibc 2.34+ x86-64 | Details |
| dirdb_rust-0.2.0-cp311-cp311-macosx_11_0_arm64.whl | CPython 3.11 | CPython 3.11 | macOS 11.0+ ARM64 | Details |
Total release size: 4.3 MB
Release files / dirdb_rust-0.2.0.tar.gz
| Download URL | dirdb_rust-0.2.0.tar.gz |
|---|---|
| Size | 20.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
95b688b7258f6581db1b62bf017dc3f4a4fb64eaa031aeb1360a82949aba7fe8
|
|
BLAKE2b-256 checksum How to use checksums |
0960df0e8a0427f2362d5d6560dab491963edc987f2b0ffc01bb8a6d6103fab1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jul 13, 2026.
Transparency logRelease files / dirdb_rust-0.2.0-cp311-cp311-win_amd64.whl
| Download URL | dirdb_rust-0.2.0-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 1.3 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
d27aaf88ade167ab0e82ffb09e7085e5899045790befb7272310418e9e586f3e
|
|
BLAKE2b-256 checksum How to use checksums |
5c48c084e41580d3a35476ace7640fbcef1b537565422336da7534d8ed6f1c87
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jul 13, 2026.
Transparency logRelease files / dirdb_rust-0.2.0-cp311-cp311-manylinux_2_34_x86_64.whl
| Download URL | dirdb_rust-0.2.0-cp311-cp311-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 1.6 MB |
| Tags | CPython 3.11 Linux glibc 2.34+ x86-64 |
|
SHA-256 checksum How to use checksums |
35320c8e0089dddf9a7d6aea6713e5531c4d31e43c2e5b2a891a4387c219bff6
|
|
BLAKE2b-256 checksum How to use checksums |
f9c252ceb546f0bf26140b924ab0cd2fd596dff596bb242bc9bace4c0aa589c1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jul 13, 2026.
Transparency logRelease files / dirdb_rust-0.2.0-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | dirdb_rust-0.2.0-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
465d734cc2985603e20cbeeab49d849f3a3554e63e327ef466638c5234391033
|
|
BLAKE2b-256 checksum How to use checksums |
55925b6623eac19863c19f0c48b3ad81c958b4e71b87632aee14b70ea0089721
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jul 13, 2026.
Transparency logSecurity for DirDB-Rust 0.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 4 files in this release have been uploaded with provenance metadata.
Attestation for dirdb_rust-0.2.0.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 Jul 13, 2026.
Transparency logA 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.