datalad_next.iter_collections.iter_zip

datalad_next.iter_collections.iter_zip(path: Path, *, fp: bool = False) Generator[ZipfileItem, None, None][source]

Uses the standard library zipfile module to report on ZIP-files

A ZIP archive can represent more or less the full bandwidth of file system properties, therefore reporting on archive members is implemented similar to iter_dir(). The iterator produces an ZipfileItem instance with standard information on file system elements, such as size, or mtime.

Parameters:
  • path (Path) -- Path of the ZIP archive to report content for (iterate over).

  • fp (bool, optional) -- If True, each file-type item includes a file-like object to access the file's content. This file handle will be closed automatically when the next item is yielded or the function returns.

Yields:

ZipfileItem -- The name attribute of an item is a str with the corresponding archive member name (in POSIX conventions).