roboto.file_infra.object_store#
Submodules#
Package Contents#
- type roboto.file_infra.object_store.CredentialProvider = Callable[[], Credentials]#
- class roboto.file_infra.object_store.Credentials#
Bases:
TypedDictThis interface is driven by botocore.credentials.RefreshableCredentials
- access_key: str#
- expiry_time: str | None#
- region: str#
- secret_key: str#
- token: str#
- class roboto.file_infra.object_store.FutureLike#
Bases:
Protocol[T_co]Protocol for future-like objects.
- done()#
Return True if the future is done.
- Return type:
bool
- result()#
Wait for and return the result.
- Return type:
T_co
- class roboto.file_infra.object_store.ObjectStore#
Bases:
ProtocolBase class for protocol classes.
Protocol classes are defined as:
class Proto(Protocol): def meth(self) -> int: ...
Such classes are primarily used with static type checkers that recognize structural subtyping (static duck-typing), for example:
class C: def meth(self) -> int: return 0 def func(x: Proto) -> int: return x.meth() func(C()) # Passes static type check
See PEP 544 for details. Protocol classes decorated with @typing.runtime_checkable act as simple-minded runtime protocols that check only the presence of given attributes, ignoring their type signatures. Protocol classes can be generic, they are defined as:
class GenProto(Protocol[T]): def meth(self) -> T: ...
- classmethod create(credential_provider, **kwargs)#
- Parameters:
credential_provider (CredentialProvider)
- Return type:
- put(source, destination_uri)#
Uploads a local file to a specific cloud URI.
- Parameters:
source (pathlib.Path) – Local path to the file.
destination_uri (str) – Full URI (e.g., ‘s3://my-bucket/folder/data.csv’)
- Return type:
FutureLike[None]
- class roboto.file_infra.object_store.S3Store(s3_client, transfer_config=None)#
Bases:
roboto.file_infra.object_store.object_store.ObjectStoreBase class for protocol classes.
Protocol classes are defined as:
class Proto(Protocol): def meth(self) -> int: ...
Such classes are primarily used with static type checkers that recognize structural subtyping (static duck-typing), for example:
class C: def meth(self) -> int: return 0 def func(x: Proto) -> int: return x.meth() func(C()) # Passes static type check
See PEP 544 for details. Protocol classes decorated with @typing.runtime_checkable act as simple-minded runtime protocols that check only the presence of given attributes, ignoring their type signatures. Protocol classes can be generic, they are defined as:
class GenProto(Protocol[T]): def meth(self) -> T: ...
- Parameters:
s3_client (botocore.client.BaseClient)
transfer_config (Optional[boto3.s3.transfer.TransferConfig])
- classmethod create(credential_provider, **kwargs)#
Factory function to assemble an S3Store with refreshable credentials.
- Parameters:
credential_provider (roboto.file_infra.object_store.object_store.CredentialProvider)
- Return type:
- put(source, destination_uri)#
Uploads a local file to a specific cloud URI.
- Parameters:
source (pathlib.Path) – Local path to the file.
destination_uri (str) – Full URI (e.g., ‘s3://my-bucket/folder/data.csv’)
- Return type:
roboto.file_infra.object_store.object_store.FutureLike[None]
- class roboto.file_infra.object_store.StoreRegistry#
- classmethod get_store_for_uri(uri, credential_provider, **kwargs)#
Parses URI -> Finds Class -> Calls Class.create() -> Returns Instance
- Parameters:
uri (str)
credential_provider (roboto.file_infra.object_store.object_store.CredentialProvider)
- Return type:
- classmethod register(scheme)#
Class Decorator. Registers the decorated class to handle the specific URI scheme.
- Parameters:
scheme (str)