roboto.fs.file_service#

Module Contents#

class roboto.fs.file_service.FileService(roboto_client=None, object_store_registry=None)#

Application service for performing upload and download to the Roboto Platform.

Agnostic to object store provider.

Parameters:
download(files, association, caller_org_id=None, on_progress=None)#

Download files from the Roboto Platform.

Parameters:
  • files (collections.abc.Sequence[roboto.fs.download_session.DownloadableFile]) – Sequence of files to download, each with source_uri and destination_path.

  • association (roboto.association.Association) – Association of the files to download.

  • caller_org_id (Optional[str]) – Optional organization ID for cross-org access.

  • on_progress (Optional[roboto.fs.object_store.OnProgress]) – Optional callback to be periodically called with the number of bytes downloaded.

Return type:

None

upload(files, association, destination_paths={}, batch_size=_DEFAULT_UPLOAD_BATCH_SIZE, device_id=None, caller_org_id=None, on_progress=None)#
Parameters:
  • files (collections.abc.Iterable[pathlib.Path])

  • association (roboto.association.Association)

  • destination_paths (collections.abc.Mapping[pathlib.Path, str])

  • batch_size (int)

  • device_id (Optional[str])

  • caller_org_id (Optional[str])

  • on_progress (Optional[roboto.fs.object_store.OnProgress])

Return type:

list[str]