damast.utils.io#

Attributes#

Classes#

ArchiveBackend

str(object='') -> str

Archive

Class to wrap and extract archive objects using ratarmount

Module Contents#

damast.utils.io.logger#
class damast.utils.io.ArchiveBackend#

Bases: str, enum.Enum

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.

ZIPFILE = 'zipfile'#
RATARMOUNT = 'ratarmount'#
class damast.utils.io.Archive(filenames: list[str], filter_fn: Callable[[str], bool] | None = None, backend: ArchiveBackend = None)#

Class to wrap and extract archive objects using ratarmount

filenames: list[str]#
filter_fn: Callable[[str], bool]#
_extracted_files: list[str]#
_mounted_dirs: list[pathlib.Path]#
_supported_suffixes: list[str] = None#
_backend: ArchiveBackend = None#
autoload_backend()#
supported_suffixes()#

Get the list of suffixes for archives and compressed files which are supported

supported_suffixes_zipfile()#
supported_suffixes_ratarmount()#
__enter__() list[str]#

Enter function for the contextmanager

__exit__(exc_type, exc_val, exc_tb)#

Exit function for the contextmanager

mount_ratarmount(file, target)#

Call ratarmount to mount and archive

mount_zipfile(file, target)#

Use zipfile to mount and archive

umount()#

Umount the archive

mount() list[str]#

Mount the archive (and potentially) inner archives to make the files accessible

files()#