https://github.com/astronomer/astronomer-cosmos
Run your dbt Core projects as Apache Airflow DAGs and Task Groups with a few lines of code
https://github.com/astronomer/astronomer-cosmos
airflow airflow-operators apache-airflow dbt python workflow
Last synced: 29 days ago
JSON representation
Run your dbt Core projects as Apache Airflow DAGs and Task Groups with a few lines of code
- Host: GitHub
- URL: https://github.com/astronomer/astronomer-cosmos
- Owner: astronomer
- License: apache-2.0
- Created: 2022-12-13T13:08:12.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-04-17T15:51:15.000Z (about 1 month ago)
- Last Synced: 2025-04-17T22:30:44.049Z (about 1 month ago)
- Topics: airflow, airflow-operators, apache-airflow, dbt, python, workflow
- Language: Python
- Homepage: https://astronomer.github.io/astronomer-cosmos/
- Size: 17.7 MB
- Stars: 907
- Watchers: 11
- Forks: 205
- Open Issues: 226
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGELOG.rst
- Contributing: docs/contributing.rst
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
- Security: SECURITY.rst
Awesome Lists containing this project
README
.. |fury| image:: https://badge.fury.io/py/astronomer-cosmos.svg
:target: https://badge.fury.io/py/astronomer-cosmos.. |ossrank| image:: https://img.shields.io/endpoint?url=https://ossrank.com/shield/2121
:target: https://ossrank.com/p/2121-astronomer-cosmos.. |downloads| image:: https://img.shields.io/pypi/dm/astronomer-cosmos.svg
:target: https://img.shields.io/pypi/dm/astronomer-cosmos.. |pre-commit| image:: https://results.pre-commit.ci/badge/github/astronomer/astronomer-cosmos/main.svg
:target: https://results.pre-commit.ci/latest/github/astronomer/astronomer-cosmos/main
:alt: pre-commit.ci status.. image:: https://raw.githubusercontent.com/astronomer/astronomer-cosmos/main/docs/_static/cosmos-logo.svg
===========================================================
|fury| |ossrank| |downloads| |pre-commit|
Run your dbt Core projects as `Apache Airflow® `_ DAGs and Task Groups with a few lines of code. Benefits include:
- Run dbt projects against Airflow connections instead of dbt profiles
- Native support for installing and running dbt in a virtual environment to avoid dependency conflicts with Airflow
- Run tests immediately after a model is done to catch issues early
- Utilize Airflow's data-aware scheduling to run models immediately after upstream ingestion
- Turn each dbt model into a task/task group complete with retries, alerting, etc.Quickstart
__________Check out the Getting Started guide on our `docs `_. See more examples at `/dev/dags `_ and at the `cosmos-demo repo `_.
Example Usage
___________________You can render a Cosmos Airflow DAG using the ``DbtDag`` class. Here's an example with the `jaffle_shop project `_:
..
This renders on Github but not Sphinx:https://github.com/astronomer/astronomer-cosmos/blob/24aa38e528e299ef51ca6baf32f5a6185887d432/dev/dags/basic_cosmos_dag.py#L1-L42
This will generate an Airflow DAG that looks like this:
.. figure:: https://github.com/astronomer/astronomer-cosmos/blob/main/docs/_static/jaffle_shop_dag.png
Community
_________
- Join us on the Airflow `Slack `_ at #airflow-dbtChangelog
_________We follow `Semantic Versioning `_ for releases.
Check `CHANGELOG.rst `_
for the latest changes.Contributing Guide
__________________All contributions, bug reports, bug fixes, documentation improvements, enhancements are welcome.
A detailed overview an how to contribute can be found in the `Contributing Guide `_.
As contributors and maintainers to this project, you are expected to abide by the
`Contributor Code of Conduct `_.License
_______`Apache License 2.0 `_
Privacy Notice
______________The application and this website collect telemetry to support the project's development. These can be disabled by the end-users.
Read the `Privacy Notice `_ to learn more about it.
.. Tracking pixel for Scarf
.. image:: https://static.scarf.sh/a.png?x-pxid=ae43a92a-5a21-4c77-af8b-99c2242adf93
:target: https://static.scarf.sh/a.png?x-pxid=ae43a92a-5a21-4c77-af8b-99c2242adf93Security Policy
---------------Check the project's `Security Policy `_ to learn
how to report security vulnerabilities in Astronomer Cosmos and how security issues reported to the Astronomer Cosmos
security team are handled.