DownloadDatasets package
Submodules
LOGS_solutions.DownloadDatasets.DatasetDownloader module
- class LOGS_solutions.DownloadDatasets.DatasetDownloader.DatasetDownloader(logs, args)[source]
Bases:
object
Downloads all datasets
- can_create_symlink()[source]
Check if the system supports creating symbolic links. :rtype:
bool
:return: True if the system supports creating symbolic links, False otherwise.
- download_datasets(project_path, sample_path, project, dataset)[source]
Parse and download datasets. Create symlinks if symlink_path is not None. Create metadata files if include_metadata is True.
- Parameters:
project_path (
str
) – Path where the project should be saved.sample_path (
str
) – Path where the sample should be saved.project (
Project
) – Project objectdataset (
Dataset
) – Dataset object
LOGS_solutions.DownloadDatasets.DatasetHandler module
- class LOGS_solutions.DownloadDatasets.DatasetHandler.DatasetHandler(dataset_target_path, dataset, include_metadata=False, duplicate_handling=1, symlink_path=None, original_target_path=None)[source]
Bases:
object
The class handles the parsing and downloading of unpacked data records in separate folders.
- download_dataset(filename='')[source]
Downloads the dataset and stores it in the given path.
- Parameters:
filename (
str
) – Name of the store dataset. If empty, the name of the dataset will be used.
LOGS_solutions.DownloadDatasets.FileHandler module
- class LOGS_solutions.DownloadDatasets.FileHandler.FileHandler[source]
Bases:
object
LOGS_solutions.DownloadDatasets.ProgressBar module
- class LOGS_solutions.DownloadDatasets.ProgressBar.ProgressBar[source]
Bases:
object
- classmethod progress_bar(message)[source]
Creates a progress bar for the console.
- Parameters:
message (
str
) – The message to display in front of the progress bar.
LOGS_solutions.DownloadDatasets.main module
- LOGS_solutions.DownloadDatasets.main.main(args)[source]
Main function to download datasets from a LOGS instance. Important: This classes uses absolute paths. To obtain the correct absolute path, you must ensure that the relative path is correct in relation to the directory in which the script is executed. If you are not sure, use the absolute path for target_path
- LOGS_solutions.DownloadDatasets.main.parse_args()[source]
Parses the command line arguments.
- Returns:
The parsed arguments.
- LOGS_solutions.DownloadDatasets.main.valid_bool(bool_string)[source]
Validates the given boolean string. The string can be ‘true’, ‘yes’, ‘1’, ‘false’, ‘no’, or ‘0’.
- Parameters:
bool_string (
str
) – The boolean string to validate.- Return type:
bool
- Returns:
The boolean value of the string.
- LOGS_solutions.DownloadDatasets.main.valid_duplicate_handling(dataset_handling)[source]
Validates how datasets with the same name should be handled. Options: 1: rename, 2: overwrite, 3: take first.
- Parameters:
duplicate_handling – The duplicate handling to validate.
- Return type:
int
- Returns:
The duplicate handling as an integer.