Fileexists¶
flowtask.components.FileExists
¶
FileExists
¶
Bases: FileBase
FileExists Overview
This component validate if a file or a list of files exist in a directory.
.. table:: Properties :widths: auto
+--------------+----------+-----------+-------------------------------------------------------+ | Name | Required | Summary | +--------------+----------+-----------+-------------------------------------------------------+ | file | Yes | A dictionary containing two values, "pattern" and "value", | | | | "pattern" and "value", "pattern" contains the path of the | | | | file on the server, If it contains the mask "{value}", then | | | | "value" is used to set the value of that mask | +--------------+----------+-----------+-------------------------------------------------------+ | pattern | Yes | Allows you to replace values ( ".xls", ".csv" ) | +--------------+----------+-----------+-------------------------------------------------------+ | value | No | Name of the function and the arguments it receives for example | | | | [ "current_date", { "mask":"%Y&m%d" } -> 20220909 | +--------------+----------+-----------+-------------------------------------------------------+ | mask | No | A mask is applied with the today attribute, with date format | | | | {“Y-m-d”} | +--------------+----------+-----------+-------------------------------------------------------+ | directory | Yes | Path to validate if the file exists | +--------------+----------+-----------+-------------------------------------------------------+ | date | No | File date | +--------------+----------+-----------+-------------------------------------------------------+ | diff | No | Evaluate the difference in the file | +--------------+----------+-----------+-------------------------------------------------------+ | depens | No | The file depends on a previous process | +--------------+----------+-----------+-------------------------------------------------------+ | filename | Yes | Identify the file name | +--------------+----------+-----------+-------------------------------------------------------+
Return the validation if the file exist or not
Example:
```yaml
FileExists:
file:
pattern: '{value}-adp_worker.csv'
value:
- today
- mask: '%Y-%m-%d'
directory: /home/ubuntu/symbits/walmart/files/adfs/
```