airflow-connection-plugin

Templating for Airflow connections


Keywords
airflow, airflow-plugin, python
License
MIT
Install
pip install airflow-connection-plugin==1.0.0

Documentation

Templating for Airflow connections

PyPI version

The connection plugin contains an Airflow macro for templating connections in tasks. You can use it like this:

# prints 'mysql'
{{ macros.connection_plugin.get_conn('airflow_db').host }}

connection_plugin.get_conn returns the Connection object that you can interact with as described in the documentation.

Installation

pip install airflow-connection-plugin

Demo

To start the docker container simply run the following command in the root directory:

cd example && docker-compose up

After that you can reach the airflow frontend via http://localhost:8080. You will find an example DAG that demonstrates how to retrieve different connection information.

Attention: Be especially careful when using passwords in templates.