External Files#

class ExternalFileStatusEnum(value)[source]#

Bases: str, Enum

The state of an external file

available = 'available'#
processing = 'processing'#
class ExternalFileTypeEnum(value)[source]#

Bases: str, Enum

The state of an external file

dataset_attachment = 'dataset_attachment'#
class ExternalFile(*, id, file_type, created_on, status, file_name, description=None, provenance, sha256sum, file_size)[source]#

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Parameters:
id: int#
file_type: ExternalFileTypeEnum#
created_on: datetime#
status: ExternalFileStatusEnum#
file_name: str#
description: str | None#
provenance: Dict[str, Any]#
sha256sum: str#
file_size: int#
propagate_client(client)[source]#
get_direct_url()[source]#
download(destination_path, overwrite=False)[source]#

Downloads an external file to the given path

The file size and checksum will be checked against the metadata stored on the server

Parameters:
  • destination_path (str) – Full path to the destination file (including filename)

  • overwrite (bool) – If True, allow for overwriting an existing file. If False, and a file already exists at the given destination path, an exception will be raised.

Return type:

None