Skip to content

Downloadfromd2L

flowtask.components.DownloadFromD2L

DownloadFromD2L

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

Bases: D2LClient, DownloadFromBase

DownloadFromD2L

Overview

Download Data from D2L.

Properties (inherited from D2LClient and DownloadFromBase)

.. table:: Properties :widths: auto

+--------------------+----------+-----------+----------------------------------------------------------------------+
| Name               | Required | Summary                                                                          |
+--------------------+----------+-----------+----------------------------------------------------------------------+
| credentials        |   Yes    | Credentials to establish connection with Polestar site (user and password)       |
|                    |          | get credentials from environment if null.                                        |
+--------------------+----------+-----------+----------------------------------------------------------------------+
| filename           |   Yes    | The filename to use for the downloaded file.                                     |
+--------------------+----------+-----------+----------------------------------------------------------------------+
| Action             |   No     | Select 'download' or 'awards'. (Default: download)                               |
+--------------------+----------+-----------+----------------------------------------------------------------------+
| schema             |   No     | The ID of the Schema to download. Required if action is 'download'               |
+--------------------+----------+-----------+----------------------------------------------------------------------+
| org_units          |   No     | A list of ID of Organization Units. Required if action is 'awards'               |
+--------------------+----------+-----------+----------------------------------------------------------------------+
| column             |   No     | A column name to extract the list of Organization Units. Required if action is   |
|                    |          | 'awards' and depends of a Pandas DataFrame.                                      |
+--------------------+----------+-----------+----------------------------------------------------------------------+
| create_destination |   No     | Boolean flag indicating whether to create the destination directory if it        |
|                    |          | doesn't exist (default: True).                                                   |
+--------------------+----------+-----------+----------------------------------------------------------------------+

Save the downloaded files on the new destination.



Example:

```yaml
DownloadFromD2L:
  domain: POLESTAR_DOMAIN
  schema: c0b0740f-896e-4afa-bfd9-81d8e43006d9
  credentials:
    username: POLESTAR_USERNAME
    password: POLESTAR_PASSWORD
  destination:
    directory: /home/ubuntu/symbits/polestar/files/organizational_unit_ancestors/
    filename: organizational_unit_ancestors_{yesterday}.zip
    overwrite: true
  masks:
    yesterday:
    - yesterday
    - mask: '%Y-%m-%d'
```