Simplest possible file store for blobs.
Project description
Simplest Possible Content-Addressable Blob Store
This is a simple content-addressable blob store. It stores blobs of data and associated metadata. The blobs are stored in a directory hierarchy based on the base58 encoding of their SHA-256 hash. Metadata is stored as siblings to the blob file.
# Create a blob store (does nothing)
blobstore = BlobStore('some-dir', hierarchy_depth=3)
# Save a blob ('some-dir/hash[0]/hash[1]/hash[2]/hash')
hash_str, file_path = blobstore.save(b'Hello, World!')
# Load a blob
blob = blobstore.load(hash_str)
# Save metadata
blobstore.store_sibling(hash_str, 'json', b'{"key": "value"}')
# Load metadata
metadata = blobstore.load_sibling(hash_str, 'json')
# Iter all items in the store
for hash_str, file_path in blobstore.iter_files(no_sibling=True):
print(hash_str, file_path)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
grugstore-0.0.2.tar.gz
(3.1 kB
view details)
Built Distribution
File details
Details for the file grugstore-0.0.2.tar.gz
.
File metadata
- Download URL: grugstore-0.0.2.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.10.6 Linux/6.5.0-27-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a813a5daf07120f2406b052cd5a78cd56074a667b52fcbe851009d1be996c9d4 |
|
MD5 | 0c1384d55312da4c66937ac3e26da133 |
|
BLAKE2b-256 | 4c8b69f4fd8c42165d7e241be7131057fc23a0529327dae0802c74e0d665c407 |
File details
Details for the file grugstore-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: grugstore-0.0.2-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.10.6 Linux/6.5.0-27-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e919f04a57fc81f17d13265db1a382666bc8f3e4f1add5cac62b4dc4326d23c9 |
|
MD5 | b568bdfe9193ada1066f8025e992be0b |
|
BLAKE2b-256 | de03107ecfb64b5e4dbebeb19b20fc911f2bd310750c64934576877a552611c7 |