Prefect scheduler for YAML configuration
Project description
Prefect YAML
Package to run prefect with YAML configuration. For further details, please refer to the documentation
Installation
Install this via pip (or your favourite package manager):
pip install prefect-yaml
Usage
Run the command line prefect-yaml
with the specified configuration
file.
For example, the following YAML configuration is located in examples/simple_config.yaml.
metadata:
output-directory: .output
task:
task_a:
caller: math:fabs
parameters:
- -9.0
output:
format: json
task_b:
caller: math:sqrt
parameters:
- !data task_a
Run the following command to generate all the task outputs to the
directory .output
in the running directory.
prefect-yaml -c examples/simple_config.yaml
The output directory contains all the task outputs in the specified format. The default format is pickle.
% tree .output
.output
├── task_a.json
└── task_b.pickle
0 directories, 2 files
Configuration
Each configuration must specify the section of metadata
and task
.
Metadata
Metadata section contains the following parameters.
Parameter | Description | Required / Optional |
---|---|---|
output-directory |
Filesystem output directory | Required |
Task
Each task is a key-value pair where the key is the name of the task, and the value is a dictionary of parameters.
Parameter | Subsection | Description | Required / Optional |
---|---|---|---|
caller |
Caller module and function name. In the format of <module>:<function> |
Required | |
parameters |
Function arguments. Either a list of unnamed arguments or a dictionary of named arguments | (Optional) | |
format |
output |
Output format. Supported stdlib formats are pickle and json . Default is pickle . |
(Optional) |
name |
output |
Name of the output file. Default is same as the task name. | (Optional) |
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for prefect_yaml-2022.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ff9f7746164d3b6a71bd73ca8f09e02fac6b4e481aeccf677ebd039fb757cb3 |
|
MD5 | 968f4e1f9465a76136a868255c8f0314 |
|
BLAKE2b-256 | c95e051d1611c645941e60a13d3b47a49857712a2044e3cd785fded310431c7e |