Downloadfrom¶
flowtask.components.DownloadFrom
¶
DownloadFromBase
¶
Bases: PandasDataframe, FlowComponent
DownloadFromBase
Abstract base class for downloading files from various sources.
Inherits from FlowComponent and PandasDataframe to provide common functionalities
for component management and data handling.
This class utilizes aiohttp for asynchronous HTTP requests and offers support
for authentication, SSL connections, and basic file management.
.. note:: This class is intended to be subclassed for specific download implementations.
.. table:: Properties :widths: auto
+----------------------+----------+-----------+-------------------------------------------------------------------------+
| Name | Required | Summary |
+----------------------+----------+-----------+-------------------------------------------------------------------------+
| credentials | Yes | Dictionary containing expected username and password for authentication |
| | | (default: {"username": str, "password": str}). |
+----------------------+----------+-------------------------------------------------------------------------------------+
| no_host | No | Boolean flag indicating whether to skip defining host and port (default: False). |
+----------------------+----------+-----------+-------------------------------------------------------------------------+
| overwrite | No | Boolean flag indicating whether to overwrite existing files (default: True). |
+----------------------+----------+-----------+-------------------------------------------------------------------------+
| overwrite | No | Boolean flag indicating whether to overwrite existing files (default: True). |
+----------------------+----------+-----------+-------------------------------------------------------------------------+
| create_destination | No | Boolean flag indicating whether to create the destination directory |
| | | if it doesn't exist (default: True). |
+----------------------+----------+-----------+-------------------------------------------------------------------------+
| rename | No | String defining a new filename for the downloaded file. |
+----------------------+----------+-----------+-------------------------------------------------------------------------+
| file | Yes | Access the file download through a url, with the required user credentials and |
| | | password |
+----------------------+----------+-----------+-------------------------------------------------------------------------+
| download | Yes | File destination and directory |
+----------------------+----------+-----------+-------------------------------------------------------------------------+
| source | Yes | Origin of the file to download and location where the file is located. |
+----------------------+----------+-----------+-------------------------------------------------------------------------+
| destination | Yes | Destination where the file will be save. |
+----------------------+----------+-----------+-------------------------------------------------------------------------+
| ssl | No | Boolean flag indicating whether to use SSL connection (default: False). |
+----------------------+----------+-----------+-------------------------------------------------------------------------+
| ssl_cafile | No | Path to the CA certificate file for SSL verification. |
+----------------------+----------+-----------+-------------------------------------------------------------------------+
| ssl_certs | No | List of certificate chains for SSL verification. |
+----------------------+----------+-----------+-------------------------------------------------------------------------+
| host | No | Hostname for the download source (default: "localhost"). |
+----------------------+----------+-----------+-------------------------------------------------------------------------+
| port | No | Port number for the download source (default: 22). |
+----------------------+----------+-----------+-------------------------------------------------------------------------+
| timeout | No | Timeout value in seconds for HTTP requests (default: 30). |
+----------------------+----------+-----------+-------------------------------------------------------------------------+
| url | No | URL of the download source (populated within the class). |
+----------------------+----------+-----------+-------------------------------------------------------------------------+
| headers | Yes | Dictionary containing HTTP headers for the request. |
+----------------------+----------+-----------+-------------------------------------------------------------------------+