Coder Social home page Coder Social logo

juldrixx / astronomer-cosmos Goto Github PK

View Code? Open in Web Editor NEW

This project forked from astronomer/astronomer-cosmos

0.0 0.0 0.0 10.76 MB

A framework for generating Apache Airflow DAGs from other authoring interfaces.

Home Page: https://astronomer.github.io/astronomer-cosmos/

License: Apache License 2.0

Python 100.00%

astronomer-cosmos's Introduction

https://github.com/astronomer/astronomer-cosmos/raw/main/docs/_static/banner.png

Astronomer Cosmos fury ossrank downloads pre-commit.ci status

A framework for dynamically generating Apache Airflow DAGs from other tools and frameworks. Develop your workflow in your tool of choice and render it in Airflow as a DAG or Task Group!

Current support for:
  • dbt
Coming soon:
  • Jupyter
  • Hex
  • And more...open an issue if you have a request!

Quickstart

Check out the Quickstart guide on our docs.

Example Usage (dbt)

Cosmos lets you render dbt projects as Airflow DAGs and Task Groups. To render a DAG, import DbtDag and point it to your dbt project.

from pendulum import datetime
from airflow import DAG
from cosmos.providers.dbt.dag import DbtDag

# dag for the project jaffle_shop
jaffle_shop = DbtDag(
    dbt_project_name="jaffle_shop",
    conn_id="airflow_db",
    dbt_args={
        "schema": "public",
    },
    dag_id="jaffle_shop",
    start_date=datetime(2022, 11, 27),
)

Simiarly, you can render an Airflow TaskGroups using the DbtTaskGroup class. Here's an example with the jaffle_shop project:

from pendulum import datetime

from airflow import DAG
from airflow.operators.empty import EmptyOperator
from cosmos.providers.dbt.task_group import DbtTaskGroup


with DAG(
    dag_id="extract_dag",
    start_date=datetime(2022, 11, 27),
    schedule="@daily",
):

    e1 = EmptyOperator(task_id="ingestion_workflow")

    dbt_tg = DbtTaskGroup(
        group_id="dbt_tg",
        dbt_project_name="jaffle_shop",
        conn_id="airflow_db",
        dbt_args={
            "schema": "public",
        },
    )

    e2 = EmptyOperator(task_id="some_extraction")

    e1 >> dbt_tg >> e2

Changelog

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

astronomer-cosmos's People

Contributors

chrishronek avatar jlaneve avatar iancmoritz avatar pre-commit-ci[bot] avatar petedejoy avatar mikewallis42 avatar pankajkoti avatar jbandoro avatar dimberman avatar fritz-astronomer avatar tatiana avatar dwreeves avatar mmenalla avatar shashanksinghfd avatar rnhttr avatar ryw avatar dh-racheldean avatar szecsip avatar patawan avatar kaxil avatar julienledem avatar juldrixx avatar josh-fell avatar jacobsalway avatar denimalpaca avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.