datalad_next.archive_operations
Handler for operations on various archive types
All handlers implement the API defined by ArchiveOperations
.
Available handlers:
TAR archive operation handler |
|
ZIP archive operation handler |
- class datalad_next.archive_operations.ArchiveOperations(location: Any, *, cfg: ConfigManager | None = None)[source]
Bases:
ABC
Base class of all archives handlers
Any handler can be used as a context manager to adequately acquire and release any resources necessary to access an archive. Alternatively, the
close()
method can be called, when archive access is no longer needed.In addition to the
open()
method for accessing archive item content, each handler implements the standard__contains__()
, and__iter__()
methods.__contains__() -> bool
reports whether the archive contains an items of a given identifier.__iter__()
provides an iterator that yieldsFileSystemItem
instances with information on each archive item.- property cfg: ConfigManager
ConfigManager given to the constructor, or the session default