h1st.model_repository.storage.s3 module

class h1st.model_repository.storage.s3.S3Storage(bucket_name: str = '', prefix: str = '')[source]

Bases: h1st.model_repository.storage.base.Storage

Provide data storage on top of AWS S3

__init__(bucket_name: str = '', prefix: str = '')[source]
Parameters
  • bucket_name – s3 bucket name to store data into

  • prefix – s3 object prefix, leave blank to store at bucket root

get_obj(name: str) → Any[source]

Retrieve object value

Parameters

name – object name

get_bytes(name) → bytes[source]

Retrieve object value in bytes

Parameters

name – object name

set_obj(name: str, value: Any) → NoReturn[source]

Set key value to a python object

Parameters
  • name – object name

  • value – value in python object

set_bytes(name: str, value: bytes) → NoReturn[source]

Set a key value to a list of bytes

Parameters
  • name – object name

  • value – value in bytes

exists(name: str) → bool[source]

Return true if object exists in the storage

delete(name: str) → NoReturn[source]

Delete an object in storage