Metadata-Version: 2.1
Name: sojourner
Version: 0.0.3
Summary: a minimal tool for managing client data stored in GCP
Home-page: https://github.com/withmartian/sojourner
Author: shy
Author-email: sasha@withmartian.com
License: Apache Software License 2.0
Keywords: nbdev jupyter notebook python
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: License :: OSI Approved :: Apache Software License
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: google-cloud-storage
Requires-Dist: pydantic
Requires-Dist: python-dotenv
Provides-Extra: dev
Requires-Dist: nbdev; extra == "dev"
Requires-Dist: pre-commit; extra == "dev"
Requires-Dist: setuptools; extra == "dev"

# sojourner


<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

## Install

``` sh
pip install sojourner
```

It is likely that running this project will require a `.env` with a
bucket name as well as application credentials.

## Usage

``` python
import json
from sojourner import Sojourner

client = Sojourner()

data = json.dumps({"key": "value"}).encode()
success = client.store("client1", "sample.json", data, manifest="This is a sample JSON blob", version="1.0")
print(f"Store blob success: {success}")

# will fail after first run because overwriting is not allowed
retrieved_data, retrieved_metadata = client.get("client1", "sample.json")
print(f"Retrieved data: {json.loads(retrieved_data.decode())}")
print(f"Retrieved metadata: {retrieved_metadata}")

blob_list = client.list("client1")
print(f"Blob list: {blob_list}")
```

    Store blob success: True
    Retrieved data: {'key': 'value'}
    Retrieved metadata: Metadata(manifest: This is a sample JSON blob, timestamp: 2024-08-15 16:20:46, content_hash: 9724c1e2..., additional_info: {"version": "1.0"})
    Blob list: ['sample.csv', 'sample.json']
