airflow-cron

Generate declarative Airflow DAG models from cron configuration.

Build Status codecov License PyPI

from airflow_cron import CronAirflowConfiguration, create_dags

config = CronAirflowConfiguration.model_validate(
    {
        "job": {
            "backup": {
                "schedule": "0 2 * * *",
                "command": "/opt/jobs/backup",
            }
        }
    }
)

dag_models = create_dags(config)

Each enabled user-crontab job becomes one airflow-pydantic DAG containing one Bash task. The result can be instantiated directly or added to an airflow-config configuration.

Documentation

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

Ecosystem

Note

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