socio4health.utils.extractor_utils.compressed2files#
- socio4health.utils.extractor_utils.compressed2files(input_archive, target_directory, down_ext, current_depth=0, max_depth=5, found_files={})[source]#
Extract files from a compressed archive and return the paths of the extracted files.
- Parameters:
input_archive (str) – The path to the compressed archive file.
target_directory (str) – The directory where the extracted files will be saved.
down_ext (list) – A list of file extensions to filter the extracted files.
current_depth (int, optional) – The current depth of extraction, used to limit recursion depth. Default is 0.
max_depth (int, optional) – The maximum depth of extraction is to prevent infinite recursion. Default is 5.
found_files (set, optional) – A set to keep track of already found files, used to avoid duplicates. Default is an empty set.
- Returns:
A
set
containing the paths of the extracted files that match the specified extensions.- Return type:
set