pymovements.utils.archives.extract_archive
- pymovements.utils.archives.extract_archive(source_path: Path, destination_path: Path | None = None, recursive: bool = True, remove_finished: bool = False) Path[source]
Extract an archive. The archive type and a possible compression is automatically detected from the file name. If the file is compressed but not an archive the call is dispatched to
_decompress().- Parameters:
source_path (Path) – Path to the file to be extracted.
destination_path (Path, optional) – Path to the directory the file will be extracted to. If omitted, the directory of the file is used.
recursive (bool) – Recursively extract archives which are included in extracted archive.
remove_finished (bool) – If
True, remove the file after the extraction.
- Returns:
Path to the directory the file was extracted to.
- Return type:
Path