extract_file
extract_file#
- extract_file(file_path: Union[str, cloudpathlib.cloudpath.CloudPath, pathlib.Path], output: Union[str, cloudpathlib.cloudpath.CloudPath, pathlib.Path], overwrite: bool = False) Union[list, cloudpathlib.cloudpath.CloudPath, pathlib.Path] [source]#
Extract an archived file (zip or others). Overwrites if specified. For zipfiles, in case of multiple folders archived, pay attention that what is returned is the first folder.
>>> file_path = 'D:/path/to/zip.zip' >>> output = 'D:/path/to/output' >>> extract_file(file_path, output, overwrite=True) D:/path/to/output.zip'