Skip to content

Unzip

flowtask.components.Unzip

Unzip

Unzip(loop=None, job=None, stat=None, **kwargs)

Bases: CompressSupport, FileCopy

Unzip

Overview

    The Unzip class is a component for decompressing ZIP files in specified directories.
    It supports selecting specific files within the archive, applying directory masks, and
    optionally deleting the source ZIP file after extraction.

.. table:: Properties
:widths: auto

    +----------------+----------+-----------+---------------------------------------------------------------+
    | Name           | Required | Summary                                                                   |
    +----------------+----------+-----------+---------------------------------------------------------------+
    | filename       |   Yes    | The name of the ZIP file to decompress.                                   |
    +----------------+----------+-----------+---------------------------------------------------------------+
    | directory      |   Yes    | The target directory for decompression.                                   |
    +----------------+----------+-----------+---------------------------------------------------------------+
    | extract        |   No     | Dictionary specifying files to extract and/or target output directory.    |
    +----------------+----------+-----------+---------------------------------------------------------------+
    | delete_source  |   No     | Boolean indicating if the ZIP file should be deleted after extraction.    |
    +----------------+----------+-----------+---------------------------------------------------------------+
    | password       |   No     | Optional password for encrypted ZIP files.                                |
    +----------------+----------+-----------+---------------------------------------------------------------+

Returns

    This component extracts the specified files from a ZIP archive into the target directory and
    returns a list of extracted file paths. Metrics such as the output directory and ZIP file name
    are tracked, and any errors related to file extraction or directory creation are logged for
    debugging purposes. If specified, the original ZIP file is deleted after extraction.