Code Monkey home page Code Monkey logo

airflow-dynamic-etl's Introduction

airflow-dynamic-etl

Create dynamic-etl via registry pattern. Let developer build ETL without touching DAG.

Use case

example registed ETL code

# register function to extract, transform, load
@ETLCrawler.register_extract(1)
    def extract(self, ds, **task_kwargs):
    ...
@ETLCrawler.register_transform(1)
    def transform(self, *args, **kwargs):
    ...
@ETLCrawler.register_load(1)
    def load(self, *args, **kwargs):

example ETL DAG

# get etl task list
etl_extract_task_list = etl_class.get_extract_tasks(etl)
etl_transform_task_list = etl_class.get_transform_tasks(etl)
etl_load_task_list = etl_class.get_load_tasks(etl)
etl_task_list = etl_extract_task_list + etl_transform_task_list + etl_load_task_list

# create ETL DAG
ETL_dag_id, ETL_dag = create_ETLDag(etl_name, etl_cron_time, etl_task_list)
    globals()[ETL_dag_id] = ETL_dag

File structure

.
├── LICENSE
├── README.md
├── __init__.py
├── etl
│   ├── __init__.py
│   ├── etl_register.py  # ETL register pattern
│   ├── example_crawler_etl.py # registed ETL
├── example_etl_dag.py # ETL DAG
└── utils
    ├── __init__.py
    └── etl_utils.py # utils for get ETL from etl_register

airflow-dynamic-etl's People

Contributors

jie8357ioii avatar

Watchers

 avatar  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.