CompressionsHelper Module¶
Utilities for extracting and handling compressed archive formats.
- class HMB.CompressionsHelper.CompressionsHelper[source]¶
Bases:
objectConvenience wrappers to extract various archive formats. This class provides methods to extract common archive formats such as .tar, .zip, .7z, and .rar. It uses the standard library for .tar and .zip files, and optional third-party libraries for .7z and .rar files. If the required third-party library is not installed, an ImportError will be raised.
- ExtractFileUsingTarfile(path, destination)[source]¶
Extract a tar/ tar.gz / tar.bz2 archive using the standard library tarfile.
- ExtractFileUsingZipfile(path, destination)[source]¶
Extract a ZIP archive using the standard library zipfile.
- ExtractFileUsing7zfile(path, destination)[source]¶
Extract a 7-zip (.7z) archive using the optional py7zr package. If py7zr is not installed an ImportError will be raised.
- ExtractFileUsingRarfile(path, destination)[source]¶
Extract a RAR archive using the optional rarfile package. If rarfile is not installed an ImportError will be raised.
- ExtractFileUsingUnrar(path, destination)[source]¶
Extract a RAR archive using the optional unrar package (alternate to rarfile). If unrar is not installed an ImportError will be raised.