Skip to main content

Kedro Templar

About

A plugin build for Kedro to support templating configuration files. Using this plugin you can specify a templates for your configuration files such as catalog.yaml, paramters.yaml and fill them automatically using one file with specified variables. Using this approach you can easily parametrize you pipeline from single point.

Usage examples:

  • you can store multiple simultaneous configurations and switch between them on demand.
  • change prefixes in catalog.yaml to reuse the same pipeline for different data,

Install

Plugin can be easily installed using pypi repository.

pip install kedro-templar

Templates

kedro-templar is using jinja2 templating engine for rendering files.

Example

catalog.yaml

Let's create a template for conf/base/catalog.yaml in templates/base/catalog.yaml.

sample_data:
  type: pandas.CSVDataSet
  save_args:
    index: True
  filepath: s3://your_bucket/{{run_name}}/{{another_subname}}/data/sample_data.csv

definition.yaml

Your file that contains all variables used for templating.

run_name: run_1
another_subname: subfolder

Render templates

To render created template with provided variables run following command:

kedro templar apply -c definition.yaml

If you choose to have different setup, you can check help command to see all available options:

kedro templar apply --help

Commands

Currently, this plugin supports 3 commands:

apply

A core logic of this plugin. This command is used to create config files based on provided templates and a file with variables.

You can setup a default values using environment variables:

  • TEMPLAR_TEMPLATES_DIR - a default directory for your templates
  • TEMPLAR_OUTPUT_DIR - a default directory where templates will be rendered

If no value is specified explicitly and env var is empty, the commands will use default value specified in the code.

kedro templar apply -c definition.yaml

download

A helper function used to download a config file from a given S3 path

kedro templar download -i <S3_PATH>/definition.yaml -o definition.yaml

upload

A helper function used to upload a config file to a given S3 path

kedro templar upload -i definition.yaml -o <S3_PATH>/definition.yaml

Contact

Plugin was created by the Data Science team from WebInterpret.

Metadata

Release files for kedro-templar 0.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kedro-templar 0.0.7
File Size Uploaded
kedro_templar-0.0.7.tar.gz 7.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for kedro-templar 0.0.7
File Interpreter ABI Platform
kedro_templar-0.0.7-py3-none-any.whl Python 3 none any Details

Total release size: 13.8 kB

Release files / kedro_templar-0.0.7.tar.gz

Download URL kedro_templar-0.0.7.tar.gz
Size 7.3 kB
Tags Source
SHA-256 checksum
How to use checksums
c636d40efba917ca5e73d273d15b70520eaa23f73e4e9fb51c391c4518a6234c
BLAKE2b-256 checksum
How to use checksums
4710f3a027d05a1b3b13848caff37766bd6dd10a500456402c4d39bd9afc74ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / kedro_templar-0.0.7-py3-none-any.whl

Download URL kedro_templar-0.0.7-py3-none-any.whl
Size 6.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9c3276fed47612ffcfc25b79903484256af98dacb0c91e573ed523bc6587b2a4
BLAKE2b-256 checksum
How to use checksums
a279bff2e6dd2cd20efc79c473d566a61e28cd5451d6fb0a93b51b6b1f66457c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release history Release notifications | RSS feed

This release

0.0.7 This release

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page