extract module

Extract conda packages to the filesystem.

Extract package to directory, with checks against tar members extracting outside the target directory.

conda_package_streaming.extract.extract(filename, dest_dir=None, fileobj=None)

Extract all components of conda package to dest_dir.

fileobj: must be seekable if provided, if a .conda package.

conda_package_streaming.extract.extract_stream(stream: Generator[tuple[tarfile.TarFile, tarfile.TarInfo]], dest_dir: Path | str)

Pipe stream_conda_component output here to extract every member into dest_dir.

For .conda will need to be called twice (for info and pkg components); for .tar.bz2 every member is extracted.