a minimal tool for managing client data stored in GCP
Project description
sojourner
Install
pip install sojourner
It is likely that running this project will require a .env with a
bucket name as well as application credentials.
Usage
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']
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
sojourner-0.0.2.tar.gz
(8.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sojourner-0.0.2.tar.gz.
File metadata
- Download URL: sojourner-0.0.2.tar.gz
- Upload date:
- Size: 8.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f8f4e55f9da4c4a91e47e5de735b412c83522d6af30bd1b89d6b9c9ec479046
|
|
| MD5 |
5b72747c4eeab66c140e2972cf5708fd
|
|
| BLAKE2b-256 |
2c19213e84f845b9121c0cd19aa5374b3ee70316c140a89f6863353f37bbae3c
|
File details
Details for the file sojourner-0.0.2-py3-none-any.whl.
File metadata
- Download URL: sojourner-0.0.2-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c7154386e077c8a3967c797d925da29debaefb5630268286308dff2607c2a978
|
|
| MD5 |
0761a7233a9301fced91e16a8b131f8b
|
|
| BLAKE2b-256 |
77fec38afd042e9a5fa2e0bb70ee55c6b1c6974dc4ae7592c408600698d1d0be
|