extract_archives()¶
- audeer.extract_archives(archives, destination, *, keep_archive=True, verbose=False)[source]¶
Extract multiple ZIP or TAR.GZ archives at once.
- Parameters
- Return type
- Returns
paths of extracted files relative to
destintation
in order they were added to the archives- Raises
FileNotFoundError – if an archive is not found
IsADirectoryError – if an archive is a directory
NotADirectoryError – if
destination
is not a directoryRuntimeError – if an archive is not a ZIP or TAR.GZ file
RuntimeError – if an archive file is malformed
Examples
>>> _ = touch("a.txt") >>> create_archive(".", ["a.txt"], "archive.zip") >>> _ = touch("b.txt") >>> create_archive(".", ["b.txt"], "archive.tar.gz") >>> extract_archives(["archive.zip", "archive.tar.gz"], ".") ['a.txt', 'b.txt']