Skip to main content

Auto-generated Diagrams from Airflow DAGs.

Project description

airflow-diagrams

pre-commit.ci status test workflow codecov PyPI version License PyPI - Python Version

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

NOTE: Make sure you have Graphviz installed.

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

airflow-diagrams-1.1.0rc1.tar.gz (12.9 kB view details)

Uploaded Source

Built Distribution

airflow_diagrams-1.1.0rc1-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

Details for the file airflow-diagrams-1.1.0rc1.tar.gz.

File metadata

  • Download URL: airflow-diagrams-1.1.0rc1.tar.gz
  • Upload date:
  • Size: 12.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.9.10 Linux/5.11.0-1027-azure

File hashes

Hashes for airflow-diagrams-1.1.0rc1.tar.gz
Algorithm Hash digest
SHA256 32e5c221c2a0af5a1acf3f2c9d2a6a5551395bbade8a957ea3c36e6698197635
MD5 37f22a8f1923e7d10c4500793c22fb54
BLAKE2b-256 53df3ce6cdd402f0547498552e57558a4c9bdcdf72b1615bd4f86845514e2604

See more details on using hashes here.

File details

Details for the file airflow_diagrams-1.1.0rc1-py3-none-any.whl.

File metadata

File hashes

Hashes for airflow_diagrams-1.1.0rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 bbada109d432d5688265170c1cc86e5f140a1a9aed5ce125e6ac3aab9fa3b910
MD5 30c1f291ac7dfb39872292f3ad633f4a
BLAKE2b-256 11cab4a2801d432f270917e54ee3b70af70c02cb0bc515b0c38f56967909eebd

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page