lair.records.unzip#
- lair.records.unzip(zf, dir_path=None)[source]#
Unzip a file into a folder.
- Parameters:
See also
wget_downloadDownloads files and unzips them.
Examples
>>> import tempfile, zipfile >>> from pathlib import Path >>> from lair.records import unzip >>> folder = Path(tempfile.mkdtemp()) >>> with zipfile.ZipFile(folder / "data.zip", "w") as z: ... z.writestr("a.txt", "hello") >>> unzip(str(folder / "data.zip")) >>> (folder / "a.txt").read_text() 'hello'