msaJustPyUI Module¶
.jpcore.download
¶
Created on 2022-09-02 modified version, original from JustPy @author: wf (modification swelcker)
Classes¶
Download ¶
Utility functions for downloading data
Functions¶
download_backup_file
staticmethod
¶
download_backup_file(
url: str,
file_name: str,
target_directory: str,
force: bool = False,
) -> str
Downloads from the given url the zip-file and extracts the file corresponding to the given file_name.
PARAMETER | DESCRIPTION |
---|---|
url |
url linking to a downloadable gzip file
TYPE:
|
file_name |
Name of the file that should be extracted from gzip file
TYPE:
|
target_directory |
download the file this directory
TYPE:
|
force |
True if the download should be forced
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
extract_to
|
Name of the extracted file with path to the backup directory
TYPE:
|
download_file
staticmethod
¶
needs_download
staticmethod
¶
Check if a download of the given file_path is necessary that is the file does not exist has a size of zero or the download should be forced
PARAMETER | DESCRIPTION |
---|---|
file_path |
the path of the file to be checked
TYPE:
|
force |
True if the result should be forced to True
TYPE:
|
Return
result: True if a download for this file needed
Created: September 28, 2022