# 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}")

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}")
```

    ImportError: cannot import name 'store_blob' from 'sojourner' (/Users/shy/projects/sojourner_code/sojourner/__init__.py)
    [0;31m---------------------------------------------------------------------------[0m
    [0;31mImportError[0m                               Traceback (most recent call last)
    Cell [0;32mIn[8], line 3[0m
    [1;32m      1[0m [38;5;28;01mimport[39;00m [38;5;21;01mjson[39;00m
    [0;32m----> 3[0m [38;5;28;01mfrom[39;00m [38;5;21;01msojourner[39;00m [38;5;28;01mimport[39;00m store_blob, get_blob, list_blobs, Metadata
    [1;32m      5[0m data [38;5;241m=[39m json[38;5;241m.[39mdumps({[38;5;124m"[39m[38;5;124mkey[39m[38;5;124m"[39m: [38;5;124m"[39m[38;5;124mvalue[39m[38;5;124m"[39m})[38;5;241m.[39mencode()
    [1;32m      6[0m metadata [38;5;241m=[39m Metadata(manifest[38;5;241m=[39m[38;5;124m"[39m[38;5;124mThis is a sample JSON blob[39m[38;5;124m"[39m, additional_info[38;5;241m=[39m{[38;5;124m"[39m[38;5;124mversion[39m[38;5;124m"[39m: [38;5;124m"[39m[38;5;124m1.0[39m[38;5;124m"[39m})

    [0;31mImportError[0m: cannot import name 'store_blob' from 'sojourner' (/Users/shy/projects/sojourner_code/sojourner/__init__.py)
