airflow-pydantic

Typed, serializable models for Apache Airflow DAGs, tasks, sensors, schedules, and runtime resources.

Build Status codecov License PyPI

from airflow_pydantic import BashTask, Dag

dag = Dag(
    dag_id="daily-report",
    schedule="0 6 * * *",
    start_date="2025-01-01",
    catchup=False,
    tasks={
        "report": BashTask(bash_command="python /opt/jobs/report.py"),
    },
)

print(dag.render())

Models validate configuration before Airflow parses it, support Python and YAML workflows, render standalone DAG source, and instantiate native Airflow objects. airflow-config is the recommended YAML entry point.

Documentation

Published documentation is available at airflow-laminar.github.io/airflow-pydantic.

Ecosystem

Note

This library was generated using copier from the Base Python Project Template repository.