datadings.reader.zipfile module¶
- class datadings.reader.zipfile.ZipFileReader(path: Union[str, pathlib.Path], patterns: Sequence[Union[str, pathlib.Path]] = '{LABEL}/**', labels=None, numeric_labels=True, initfun: Callable = <function noop>, convertfun: Callable = <function noop>, include=(), exclude=(), separator='\t')[source]¶
Bases:
datadings.reader.list.ListReader
Reader that reads files from a ZIP file.
Note
Functionally identical to the
DirectoryReader
, expect it reads from ZIP files instead of filesystem directories. Please refer to its documentation for more detailed explanations.- Parameters
patterns – One or more search patterns.
labels – Optional. List of labels in desired order, or path to file with one label per line. If
None
, get"label"
keys from samples, if any, and sort.numeric_labels – If true, convert labels to numeric index to list of all labels.
initfun – Callable
initfun(sample: dict)
to modify samples in-place during initialization.convertfun – Callable
convertfun(sample: dict)
to modify samples in-place before they are returned.include – Set of inclusion patterns.
exclude – Set of exclusion patterns.
separator – Separator string for file patterns.