h5rdmtoolbox.utils.DownloadFileManager#
- class h5rdmtoolbox.utils.DownloadFileManager(*args, **kwargs)[source]#
Manager for downloading files. By registering checksums and filenames, the manager can be used to download files from a remote location. The manager will check if the file is already downloaded and if the checksum matches. If the file is not downloaded, it will be downloaded and the checksum will be checked.
This class is a singleton, hence only one instance can be created.
Methods
__init__()add(*, url, filepath, filename[, checksum])Add to registry.
download(url, *[, target_folder, params, ...])Returns the downloaded file.
get(checksum, filename)Returns the file path from the registry based on checksum and filename.
load_registry()Load the registry from disk.
remove(checksum, filename)Removes a file from the registry based on checksum and filename.
remove_corrupted_file(filename)Removes a corrupted file from the registry.
reset_registry()Resets the registry.
save_registry()Save the registry to disk.
Attributes
registry_filename