grugstore


Namegrugstore JSON
Version 0.0.2 PyPI version JSON
download
home_pagehttps://github.com/jbn/grugstore
SummarySimplest possible file store for blobs.
upload_time2024-04-26 20:39:21
maintainerNone
docs_urlNone
authorgenerativist
requires_python<4.0,>=3.10
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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. 

```python
# 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)

```
            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/jbn/grugstore",
    "name": "grugstore",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.10",
    "maintainer_email": null,
    "keywords": null,
    "author": "generativist",
    "author_email": "jbn@abreka.com",
    "download_url": "https://files.pythonhosted.org/packages/4c/8b/69f4fd8c42165d7e241be7131057fc23a0529327dae0802c74e0d665c407/grugstore-0.0.2.tar.gz",
    "platform": null,
    "description": "# Simplest Possible Content-Addressable Blob Store\n\nThis is a simple content-addressable blob store. It stores blobs of data and\nassociated metadata. The blobs are stored in a directory hierarchy based on the\nbase58 encoding of their SHA-256 hash. Metadata is stored as siblings to\nthe blob file. \n\n```python\n# Create a blob store (does nothing)\nblobstore = BlobStore('some-dir', hierarchy_depth=3)\n\n# Save a blob  ('some-dir/hash[0]/hash[1]/hash[2]/hash')\nhash_str, file_path = blobstore.save(b'Hello, World!')\n\n# Load a blob\nblob = blobstore.load(hash_str)\n\n# Save metadata\nblobstore.store_sibling(hash_str, 'json', b'{\"key\": \"value\"}')\n\n# Load metadata\nmetadata = blobstore.load_sibling(hash_str, 'json')\n\n# Iter all items in the store\nfor hash_str, file_path in blobstore.iter_files(no_sibling=True):\n    print(hash_str, file_path)\n\n```",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Simplest possible file store for blobs.",
    "version": "0.0.2",
    "project_urls": {
        "Homepage": "https://github.com/jbn/grugstore",
        "Repository": "https://github.com/jbn/grugstore"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "de03107ecfb64b5e4dbebeb19b20fc911f2bd310750c64934576877a552611c7",
                "md5": "b568bdfe9193ada1066f8025e992be0b",
                "sha256": "e919f04a57fc81f17d13265db1a382666bc8f3e4f1add5cac62b4dc4326d23c9"
            },
            "downloads": -1,
            "filename": "grugstore-0.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b568bdfe9193ada1066f8025e992be0b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 3531,
            "upload_time": "2024-04-26T20:39:20",
            "upload_time_iso_8601": "2024-04-26T20:39:20.313626Z",
            "url": "https://files.pythonhosted.org/packages/de/03/107ecfb64b5e4dbebeb19b20fc911f2bd310750c64934576877a552611c7/grugstore-0.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4c8b69f4fd8c42165d7e241be7131057fc23a0529327dae0802c74e0d665c407",
                "md5": "0c1384d55312da4c66937ac3e26da133",
                "sha256": "a813a5daf07120f2406b052cd5a78cd56074a667b52fcbe851009d1be996c9d4"
            },
            "downloads": -1,
            "filename": "grugstore-0.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "0c1384d55312da4c66937ac3e26da133",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 3054,
            "upload_time": "2024-04-26T20:39:21",
            "upload_time_iso_8601": "2024-04-26T20:39:21.793319Z",
            "url": "https://files.pythonhosted.org/packages/4c/8b/69f4fd8c42165d7e241be7131057fc23a0529327dae0802c74e0d665c407/grugstore-0.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-26 20:39:21",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "jbn",
    "github_project": "grugstore",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "grugstore"
}
        
Elapsed time: 0.46627s