Auto-generated Diagrams from Airflow DAGs.
Project description
airflow-diagrams
Auto-generated Diagrams from Airflow DAGs.
This project aims to easily visualise your Airflow DAGs on service level from providers like AWS, GCP, Azure, etc. via diagrams.
🚀 Get started
To install it from PyPI run:
pip install airflow-diagrams
Then just call it like this:
Usage: airflow-diagrams generate [OPTIONS]
Generates <airflow-dag-id>_diagrams.py in <output-path> directory which
contains the definition to create a diagram. Run this file and you will get
a rendered diagram.
Options:
-d, --airflow-dag-id TEXT The dag id from which to generate the diagram.
By default it generates for all.
-h, --airflow-host TEXT The host of the airflow rest api from where to
retrieve the dag tasks information. [default:
http://localhost:8080/api/v1]
-u, --airflow-username TEXT The username of the airflow rest api.
[default: admin]
-p, --airflow-password TEXT The password of the airflow rest api.
[default: admin]
-o, --output-path DIRECTORY The path to output the diagrams to. [default:
.]
-m, --mapping-file FILE The mapping file to use for static mapping from
Airflow task to diagram node. By default no
mapping file is being used.
-v, --verbose Verbose output i.e. useful for debugging
purposes.
--help Show this message and exit.
Examples of generated diagrams can be found in the examples directory.
🤔 How it Works
ℹ️ At first it connects, by using the official Apache Airflow Python Client, to your Airflow installation to retrieve all DAGs (in case you don't specify any dag_id
) and all Tasks for the DAG(s).
🔮 Then it tries to find a diagram node for every DAGs task, by using Fuzzy String Matching, that matches the most. If you are unhappy about the match you can also provide a mapping.yml
file to statically map from Airflow task to diagram node.
🪄 Lastly it renders the results into a python file which can then be executed to retrieve the rendered diagram. 🎉
❤️ Contributing
Contributions are very welcome. Please go ahead and raise an issue if you have one or open a PR. Thank you.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for airflow-diagrams-1.0.1rc1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2b148e97bdd6236bd5864bb064e427476da4325b2cceff38c987131e839c09d |
|
MD5 | 02d9bc5fc7723c32ed42b61110c4d52f |
|
BLAKE2b-256 | e6e1a4ab6610b0a26807c932d3f4038a502606f11b32b1dcf7fe45b8e515e832 |
Hashes for airflow_diagrams-1.0.1rc1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 535074418c188b0ad91aab51e31f76b95cfa50bc7ab36f23027dd0b0143ec5e7 |
|
MD5 | 641e8491a868edd93360b9831388e54c |
|
BLAKE2b-256 | daaa97fbf680fd15fbae853db0fce7299933c84f262611b758446bafe4f16a5f |