kaxi

Run pipelines similar to github actions


License
MIT
Install
pip install kaxi==0.1.1

Documentation

kaxi

Run pipelines similar to github actions

Package version Code style: black Semantic Versions License

Installation

pip install kaxi

Usage

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()

Pipeline file

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 step
  • with (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.

Example

verbose: true

steps:
  - uses: os.path.isfile
    name: file_exists
    with:
      path: example.yaml

  - uses: kaxi.log.info
    with:
      args:
        - ${file_exists}

Environment variables

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}