Skip to main content

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 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']

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.3.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sojourner-0.0.3-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file sojourner-0.0.3.tar.gz.

File metadata

  • Download URL: sojourner-0.0.3.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for sojourner-0.0.3.tar.gz
Algorithm Hash digest
SHA256 eac282ada50b0926814ae550c39c2835ec72e548dd7bb1de19a31de93dfdc91c
MD5 3a5b6ca754be5204454a17f92c6d4a45
BLAKE2b-256 9fd28c8d94f4d1e45af6a8d670a0fe12efaffc9d7144294ab4bcd76c75390bc7

See more details on using hashes here.

File details

Details for the file sojourner-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: sojourner-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for sojourner-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ae1e831f7314cceb08c986091b15453fc03a53ba08de97c3955c1106e8fd4483
MD5 28e4a053cbe9f6e95076ce905510acb0
BLAKE2b-256 25c1566e7fb696cd6deaa9c0cda151f42155db2db0484cafa2de1c0a9d2dccbc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page