roboto.storage.object_store
Submodules
Package Contents
CredentialProvider
Credentials
FutureLike
ObjectStore
Bases: Protocol
Base 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 checkSee 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[T](Protocol):
def meth(self) -> T:
...ObjectStore.create()
Parameters
credential_provider CredentialProviderReturn type
ObjectStore.get()
Downloads a file from a cloud URI to a local path.
Parent directories of the destination path are created automatically if they don’t exist.
Parameters
source_uri strFull URI (e.g., ‘s3://my-bucket/folder/data.csv’)
destination pathlib.Local path where the file should be saved.
on_progress Optional[OnProgress]Optional callback to be periodically called with the number of bytes downloaded.
Return type
ObjectStore.put()
Uploads a local file to a specific cloud URI.
Parameters
source pathlib.Local path to the file.
destination_uri strFull URI (e.g., ‘s3://my-bucket/folder/data.csv’)
on_progress Optional[OnProgress]Optional callback to be periodically called with the number of bytes uploaded.
Return type
OnProgress
S3Store
Bases: roboto.storage.object_store.object_store.ObjectStore
Base 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 checkSee 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[T](Protocol):
def meth(self) -> T:
...Parameters
s3_client botocore.transfer_config Optional[boto3.S3Store.create()
Factory function to assemble an S3Store with refreshable credentials.
Parameters
credential_provider roboto.Return type
S3Store.get()
Downloads a file from a cloud URI to a local path.
Parent directories of the destination path are created automatically if they don’t exist.
Parameters
source_uri strFull URI (e.g., ‘s3://my-bucket/folder/data.csv’)
destination pathlib.Local path where the file should be saved.
on_progress Optional[roboto.Optional callback to be periodically called with the number of bytes downloaded.
Return type
S3Store.put()
Uploads a local file to a specific cloud URI.
Parameters
source pathlib.Local path to the file.
destination_uri strFull URI (e.g., ‘s3://my-bucket/folder/data.csv’)
on_progress Optional[roboto.Optional callback to be periodically called with the number of bytes uploaded.
Return type
StoreRegistry
StoreRegistry.get_store_for_uri()
Parameters
uri strcredential_provider roboto.StoreRegistry.register()
Class Decorator. Registers the decorated class to handle the specific URI scheme.
Parameters
scheme str