zmxtools package
Submodules
zmxtools.cli module
zmxtools.zar module
- read(input_full_file)[source]
Reads a zar archive file and generates a series of (unpacked file name, unpacked file contents) tuples.
The returned Generator produces tuples in the order found in the archive.
- class UnpackedData(file_name, unpacked_contents)[source]
Bases:
object
A structure to represent the file blocks in a zar-archive.
- Parameters:
name: A string with the name of the file contained in the archive. unpacked_contents: The unpacked (decompressed) bytes of this file.
- __annotations__ = {'file_name': <class 'str'>, 'unpacked_contents': <class 'bytes'>}
- __dataclass_fields__ = {'file_name': Field(name='file_name',type=<class 'str'>,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'unpacked_contents': Field(name='unpacked_contents',type=<class 'bytes'>,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD)}
- __hash__ = None
- __init__(file_name, unpacked_contents)
- __match_args__ = ('file_name', 'unpacked_contents')
- __repr__()
Return repr(self).
- extract(input_full_file, output_path=None)[source]
Imports the data from a zar archive file and writes it as a regular directory.