Templating for Airflow connections
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.
Metadata
Release files for airflow-connection-plugin 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| airflow-connection-plugin-1.0.0.tar.gz | 2.1 kB | Without provenance | Details for airflow-connection-plugin-1.0.0.tar.gz |
Release files / airflow-connection-plugin-1.0.0.tar.gz
| Download URL | airflow-connection-plugin-1.0.0.tar.gz |
|---|---|
| Size | 2.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
88ac4b00f4c320c3958856ca0a022338a6119d111037061a6802f9406d1faf35
|
|
BLAKE2b-256 checksum How to use checksums |
8ea33242e7a5e14797ad44e3cd183f4b77c281e5aa81dbcef3fd758ebcdca11e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.6
|
Security for airflow-connection-plugin 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.