extract_file#
- extract_file(file_path: str | CloudPath | Path, output: str | CloudPath | Path, overwrite: bool = False) CloudPath | Path [source]#
Extract an archived file (zip or others). Overwrites if specified. If the archive don’t contain a root directory with the name of the archive without the extension, create it
- Parameters:
- Returns:
Extracted directory paths
- Return type:
AnyPathType
Example
>>> file_path = 'D:/path/to/zip.zip' >>> output = 'D:/path/to/output' >>> extract_file(file_path, output, overwrite=True) D:/path/to/output/zip'