External Files#
- class ExternalFileStatusEnum(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
Bases:
str
,Enum
The state of an external file
- available = 'available'#
- processing = 'processing'#
- class ExternalFileTypeEnum(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
Bases:
str
,Enum
The state of an external file
- dataset_attachment = 'dataset_attachment'#
- pydantic model ExternalFile[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.
- Fields:
- field id: int [Required]#
- field file_type: ExternalFileTypeEnum [Required]#
- field created_on: datetime [Required]#
- field status: ExternalFileStatusEnum [Required]#
- field file_name: str [Required]#
- field description: str | None = None#
- field provenance: Dict[str, Any] [Required]#
- field sha256sum: str [Required]#
- field file_size: int [Required]#
- 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