Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Reason given by maintainers: Not ready for use

our-storage

Reed-Solomon erasure coding with Merkle integrity verification and pluggable storage backends for the ourochronos ecosystem.

Overview

our-storage provides resilient data storage through erasure coding — data is split into shards where any k-of-n shards can reconstruct the original. A Merkle tree provides cryptographic integrity verification without downloading all shards. Shards can be distributed across multiple storage backends (memory, local filesystem, S3-compatible) for redundancy. The entire implementation is pure Python with zero runtime dependencies.

Install

pip install our-storage

No runtime dependencies.

Usage

Encode and Decode

from uuid import uuid4
from our_storage import ErasureCodec, RedundancyLevel

codec = ErasureCodec(level=RedundancyLevel.PERSONAL)  # 3-of-5

# Encode data into shards
shard_set = codec.encode(b"belief data to protect", belief_id=str(uuid4()))

# Decode from any 3 of the 5 shards
available = shard_set.available_shards[:3]
result = codec.decode(available)
assert result.recovered_data == b"belief data to protect"

Redundancy Levels

Level Config Overhead Survives
MINIMAL 2-of-3 50% 1 failure
PERSONAL 3-of-5 67% 2 failures
FEDERATION 5-of-9 80% 4 failures
PARANOID 7-of-15 114% 8 failures

Integrity Verification

from our_storage import IntegrityVerifier, MerkleTree, verify_proof

# Verify all shards in a set
verifier = IntegrityVerifier()
report = verifier.verify_shard_set(shard_set)
assert report.is_valid

# Generate and verify Merkle proofs for individual shards
tree = MerkleTree.from_shards(shard_set.available_shards)
proof = tree.get_proof(0)
assert verify_proof(proof, tree.root_hash)

Distributed Storage

from our_storage import BackendRegistry, MemoryBackend, LocalFileBackend

registry = BackendRegistry()
registry.register(MemoryBackend("hot-cache"))
registry.register(LocalFileBackend("/data/shards", max_quota_bytes=10_000_000))

# Distribute shards across backends (round-robin)
locations = await registry.distribute_shard_set(shard_set)

# Retrieve and reconstruct
retrieved = await registry.retrieve_shard_set(locations)
result = codec.decode(retrieved.available_shards)

Repair Missing Shards

# Regenerate missing parity shards from available data
repaired = codec.repair(degraded_shard_set)

API

Erasure Coding

Symbol Description
ErasureCodec Encode, decode, and repair with Reed-Solomon
RedundancyLevel Predefined k-of-n configurations
ShardSet Complete set of shards with metadata and Merkle root
StorageShard Single shard with data, index, and checksum
RecoveryResult Decode outcome with timing and shard usage info

Integrity

Symbol Description
MerkleTree SHA-256 Merkle tree with proof generation
MerkleProof Path from leaf to root for individual verification
IntegrityVerifier Verify shard sets and generate integrity reports
IntegrityReport Valid/corrupted/missing counts, recovery feasibility
verify_proof() Standalone proof verification
compute_hash() SHA-256, SHA3-256, or BLAKE2b hashing

Storage Backends

Symbol Description
StorageBackend Abstract interface for pluggable backends
MemoryBackend In-memory storage (testing)
LocalFileBackend Filesystem storage with quota support
BackendRegistry Multi-backend coordinator with round-robin distribution

Development

# Install with dev dependencies
make dev

# Run linters
make lint

# Run tests
make test

# Run tests with coverage
make test-cov

# Auto-format
make format

State Ownership

Owns shard data and metadata in registered storage backends. MemoryBackend is ephemeral; LocalFileBackend persists to the configured directory.

Part of Valence

This brick is part of the Valence knowledge substrate. See our-infra for ourochronos conventions.

License

MIT

Metadata

Release files for our-storage 0.1.0

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

Source distribution (sdist)

Source distribution for our-storage 0.1.0
File Size Uploaded Provenance
our_storage-0.1.0.tar.gz 29.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for our-storage 0.1.0
File Interpreter ABI Platform
our_storage-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 51.6 kB

Release files / our_storage-0.1.0.tar.gz

Download URL our_storage-0.1.0.tar.gz
Size 29.7 kB
Tags Source
SHA-256 checksum
How to use checksums
17d6066b947d903c75963aa0f8a9c5c1a21c2720a0ae2fd5685058b1df7bd2cf
BLAKE2b-256 checksum
How to use checksums
2fd2f0106d6d3b3796350dc16717b1c20e75fe8d51f0dcc69263bc3f85ca19cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / our_storage-0.1.0-py3-none-any.whl

Download URL our_storage-0.1.0-py3-none-any.whl
Size 21.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aab70859f30fd96c83ab18773304a4aa546f81f5fb510869dbea90ce5610d354
BLAKE2b-256 checksum
How to use checksums
3f0f19412ab662bb5573c7b181c4efd8010c5021805e63f5810bf769bdba0ebf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Security for our-storage 0.1.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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