scitacean.typing.Uploader#

class scitacean.typing.Uploader(*args, **kwargs)[source]#

Handler for file uploads.

Constructors

__init__(*args, **kwargs)

Methods

connect_for_upload(dataset, ...)

Open a connection to the file server.

source_folder_for(dataset)

Files are uploaded to this directory / location.

__init__(*args, **kwargs)#
connect_for_upload(dataset, representative_file_path)[source]#

Open a connection to the file server.

Parameters:
  • dataset (Dataset) – Dataset whose files will be uploaded.

  • representative_file_path (RemotePath) – A path on the remote to check whether files for this dataset can be written. The transfer assumes that, if it is possible to write to this path, it is possible to write to the paths of all files to be uploaded.

Returns:

AbstractContextManager[UploadConnection] – A connection object that can upload files.

Raises:

RuntimeError – If files for the given dataset cannot be uploaded based on representative_file_path.

source_folder_for(dataset)[source]#

Files are uploaded to this directory / location.

This method may derive the source_folder from the given dataset or override it entirely and specify its own.

Parameters:

dataset (Dataset) – Determine the source folder for this dataset.

Returns:

RemotePath – The source folder for dataset.