# 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 store_blob, get_blob, list_blobs, Metadata

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

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

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

    Store blob success: False
    Retrieved data: {'key': 'value'}
    Retrieved metadata: manifest='This is a sample JSON blob' additional_info={'version': '1.0'}
    Blob list: ['sample.json']
