satorbis_kit.storage package

Helpers for interacting with cloud object storage backends.

class satorbis_kit.storage.CloudObjectStore(provider: str, store: obstore.store.ObjectStore, *, bucket: str | None = None, account_name: str | None = None, container: str | None = None, base_prefix: str = '')[source]

Bases: object

Generic helper for interacting with AWS S3 or Azure Blob via obstore.

build_url(remote_path: str) str[source]

Return the fully qualified URL for the given remote path.

download_file(remote_reference: str, destination: str | Path) Path[source]

Download a file given either a remote path or full URL.

classmethod from_aws(*, bucket: str, region: str | None = None, access_key_id: str | None = None, secret_access_key: str | None = None, session_token: str | None = None, base_prefix: str = '') CloudObjectStore[source]
classmethod from_azure(*, account_name: str, container: str, account_key: str | None = None, sas_token: str | None = None, client_id: str | None = None, client_secret: str | None = None, tenant_id: str | None = None, base_prefix: str = '') CloudObjectStore[source]
upload_file(local_path: str | Path, *, remote_path: str, overwrite: bool = False) str[source]

Upload a single file to cloud storage at the given remote path.

upload_files(uploads: Sequence[Tuple[str | Path, str]], *, overwrite: bool = False) List[str][source]

Upload multiple files. Each entry is a (local_path, remote_path) tuple.

exception satorbis_kit.storage.StorageError(message: str)[source]

Bases: Exception

Raised when cloud storage operations fail.

Submodules