Skip to main content

dr-store

CI PyPI

Definitions · Terms · Contracts · Changelog · dr-serialize

dr-store provides domain-neutral storage primitives for immutable records and document artifacts:

  • Content addressing identifies complete records by their declared schemas and SHA-256 hashes of their Canonical JSON Text under dr-serialize's frozen profile.
  • Object Store provides immutable puts, verified reads, and atomic bindings from opaque caller-owned keys to object references.
  • Storage backends supply the Object Store's atomic, append-only operations. MemoryBackend is process-local; SqliteBackend persists data for cross-process use.
  • Document Directory publishes one canonical Manifest beside streamed binary Sidecars.
  • Core infrastructure provides typed failures, single-segment name validation, and filesystem flush helpers.

Installation

dr-store requires Python 3.12 or newer.

python -m pip install dr-store

Usage

from dr_store import MemoryBackend, ObjectStore

store = ObjectStore(MemoryBackend())
reference, _ = store.put("example.note.v1", {"title": "hello"})
store.bind("notes/latest", reference)

assert store.resolve("notes/latest") == reference
assert store.get(reference) == {"title": "hello"}

Use SqliteBackend(path) when the stored objects and bindings must persist across processes. The rendered definitions, authoritative terms, and binding contracts describe the vocabulary, public-export mappings, and behavioral boundaries.

Filesystem and failure semantics

A Document Directory is intended for caller-coordinated single-writer use; dr-store does not enforce that policy with a lock. Allocation uses a timestamp and UUID4, but a generated-name collision raises AllocationError rather than being retried. Allocation does not flush the caller-owned root directory.

Manifest publication writes and flushes a temporary file, replaces the Manifest in the same directory, and then flushes the Document Directory. All-or-nothing visibility depends on the underlying filesystem honoring atomic same-directory replacement; network, synchronized, or other filesystems whose rename semantics are not established are outside current evidence. A failure of the final flush raises even though the replacement may already be visible, and it does not roll the Manifest back. These operations do not promise power-loss durability.

Name validation prevents lexical traversal syntax only. Manifest reads and Sidecar creation and writes follow existing final-component symlinks, so those paths require trusted, caller-controlled directory contents. Sidecar finalization flushes the Sidecar descriptor before returning its summary, but it does not flush the Sidecar's directory entry or impose ordering on an arbitrary Manifest publication. Sidecar verification is the no-follow path: it refuses final-component symlinks for both the Document Directory and named child, requires a regular direct child, and reads from the descriptor it inspected.

A failed Sidecar write raises AllocationError and may leave its descriptor open and its accounting state advanced. The writer is unusable by contract and must be abandoned; retrying it or finalizing it has no supported outcome.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dr_store-0.1.2.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dr_store-0.1.2-py3-none-any.whl (17.3 kB view details)

Uploaded Python 3

File details

Details for the file dr_store-0.1.2.tar.gz.

File metadata

  • Download URL: dr_store-0.1.2.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for dr_store-0.1.2.tar.gz
Algorithm Hash digest
SHA256 b34789803b7418af2b01875cb7a0b5d39548a08b204e944ce6e946d9ba1a7fb5
MD5 776caacc58b65fa64ca25bb763623dc7
BLAKE2b-256 ec1058e5595b059ca6386198c26229c94a04807c7a988fbf2630208776074739

See more details on using hashes here.

Provenance

The following attestation bundles were made for dr_store-0.1.2.tar.gz:

Publisher: release.yml on danielle-rothermel/dr-store

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dr_store-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: dr_store-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 17.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for dr_store-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0eb3cccbf9ccee44c16d0c740c6907a437bc6a8eb02da0be77ef44e45b04fdb5
MD5 4e61adeb71bc8c5a3e1d43031b4dd2b4
BLAKE2b-256 ec035473d46d0136f3b29c316dba51f4c829b93bb9149cdb25da6ab3fcecfa29

See more details on using hashes here.

Provenance

The following attestation bundles were made for dr_store-0.1.2-py3-none-any.whl:

Publisher: release.yml on danielle-rothermel/dr-store

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page