extract_files

Contents

extract_files#

extract_files(archives: list, output: str | CloudPath | Path, overwrite: bool = False) list[source]#

Extract all archived files. Overwrites if specified.

Example

>>> file_path = ['D:/path/to/zip1.zip', 'D:/path/to/zip2.zip']
>>> output = 'D:/path/to/output'
>>> extract_files(file_path, output, overwrite=True)
['D:/path/to/output.zip1', 'D:/path/to/output.zip2']
Parameters:
  • archives (list of str) – List of archives to be extracted

  • output (str) – Output folder where extracted files will be written

  • overwrite (bool) – Overwrite found extracted files

Returns:

Extracted files (even pre-existing ones)

Return type:

list