astronomer-cosmos
Orchestrate your dbt projects in Airflow
What it is and what it does
Astronomer Cosmos is a bridge between dbt Core and Apache Airflow that converts dbt projects into native Airflow DAGs and Task Groups. Instead of running dbt through profiles and CLI commands, you define your dbt project in Python code and Cosmos generates Airflow tasks for each model, test, and snapshot, complete with dependencies, retries, and alerting.
The package runs dbt in isolated virtual environments by default to avoid dependency conflicts with Airflow, and integrates with Airflow's connection system so you can manage data warehouse credentials through Airflow rather than dbt profiles. It enables data-aware scheduling—running dbt models immediately after upstream data ingestion—and lets you inspect and retry individual models as Airflow tasks. It depends on apache-airflow, jinja2, attrs, packaging, and several other standard libraries.
Use it for:
- Convert an existing dbt project into an Airflow DAG with minimal code changes to enable Airflow-native scheduling and monitoring.
- Run dbt tests immediately after model completion to catch data quality issues early in the pipeline.
- Manage dbt credentials and connections through Airflow's connection system instead of maintaining separate dbt profiles.
- Orchestrate dbt alongside non-dbt tasks (API calls, Python scripts, SQL queries) in a single Airflow DAG.
- Use Airflow's data-aware scheduling to trigger dbt models only after upstream data sources are refreshed.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Renders dbt Core projects as Apache Airflow DAGs and Task Groups, allowing you to orchestrate dbt workflows using Airflow's scheduling, connections, and task management instead of dbt profiles.
Yes. The package is production-stable (Development Status 5), actively maintained with recent releases, has no known vulnerabilities, and solves a real integration gap for teams using both dbt and Airflow. Install friction is low, and the Apache 2.0 license is permissive. Recommended if you orchestrate dbt workflows in Airflow.
Install
astronomer-cosmos on PyPI
pip
pip install astronomer-cosmosuv
uv add astronomer-cosmospoetry
poetry add astronomer-cosmosInstalling astronomer-cosmos
Before you install
Low friction install with a wheel distribution. Depends on apache-airflow and 8 other packages; all are standard Python libraries or Airflow ecosystem components. Actively maintained with a release 10 days ago and 1247 repository stars.
License in practice
Apache License 2.0 (permissive). You can use, modify, and distribute this package freely in commercial and open-source projects, provided you include the license notice.
Quickstart
pip install astronomer-cosmos
from cosmos import DbtDag
my_dag = DbtDag(
dag_id='my_dbt_dag',
project_dir='/path/to/dbt/project'
)
Requires Apache Airflow to be installed and configured; Python >= 3.10.
Verify before relying
- Whether virtual environment isolation for dbt is automatic or requires explicit configuration.
- Supported dbt Core versions and any version compatibility constraints.
- Performance characteristics when handling large dbt projects with many models.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 9 — aenum, apache-airflow, attrs, deprecation, jinja2, msgpack, openlineage-integration-common, packaging, virtualenv |
| Maintenance | actively maintained — 10 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 9,680,418/month — #1,506 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: astronomer_cosmos-1.15.1-py3-none-any.whl
Keywords: airflow, apache-airflow, astronomer, dags, dbt, dbt-core, dbt-fusion
Tags
More Build Tools packages
Provides reusable utilities for Python…
permissive · top 100 on PyPI
tqdmWraps any iterable to display a real-time…
copyleft · top 100 on PyPI
pippip is the standard installer for Python…
permissive · top 100 on PyPI
hatchlingHatchling is a standards-compliant Python build…
permissive · top 100 on PyPI
grpcio-toolsGenerates Python gRPC service stubs and message…
permissive · top 1,000 on PyPI
pre-commitpre-commit is a framework for installing and…
permissive · top 1,000 on PyPI
airflow-dbtProvides Airflow operators that wrap dbt CLI…
permissive · top 15,000 on PyPI
astronomer-starshipMigrates Airflow metadata—Variables,…
unclear · top 15,000 on PyPI
airflow-dbt-pythonProvides Airflow operators, hooks, and…
permissive · top 15,000 on PyPI
apache-airflow-coreApache Airflow's core runtime that schedules,…
permissive · top 5,000 on PyPI
apache-airflowApache Airflow is a platform for…
permissive · top 1,000 on PyPI
apache-airflow-providers-apache-beamIntegrates Apache Beam data processing…
permissive · top 15,000 on PyPI
prefect-dbtPrefect integration that orchestrates dbt…
permissive · top 15,000 on PyPI
apache-airflow-providers-dbt-cloudIntegrates dbt Cloud with Apache Airflow,…
permissive · top 5,000 on PyPI
apache-airflow-providers-gitIntegrates Git version control operations into…
permissive · top 15,000 on PyPI
apache-airflow-task-sdkProvides Python interfaces and task execution…
permissive · top 5,000 on PyPI