Run pipelines similar to github actions
pip install kaxi
You can run a pipeline by running the following command:
kaxi <pipeline_file>.yaml
Or you can programmatically run a pipeline by running the following command:
from kaxi import Runner
runner = Runner(your_pipeline)
runner.execute()
A pipeline file is a yaml file that contains a list of steps to execute. Each step is a dictionary with the following keys:
uses
: The callable to execute (e.g.pandas.read_csv
)name
(optional): The name of the stepwith
(optional): A dictionary of arguments to pass to the callable
If you want to use arguments without the respective name, you can use the args
key inside the with
dictionary.
verbose: true
steps:
- uses: os.path.isfile
name: file_exists
with:
path: example.yaml
- uses: kaxi.log.info
with:
args:
- ${file_exists}
You can use environment variables in your pipeline file by using the ${ENV_VAR}
syntax.
To define environment variables, you can set them inside the enviroment
key:
environment:
ENV_VAR: value
Another way to use environment variables is to use the ouput of a step as an environment variable, this can be done by using the name
of the step inside the ${}
syntax:
steps:
- uses: os.path.isfile
name: file_exists
with:
path: example.yaml
- uses: kaxi.log.info
with:
args:
- ${file_exists}