Skip to main content

Small decorator based DAG to orchestrate jobs

Project description

minidag

PyPI - Python Version

Bare minimum DAG implementation for in-process sorting of jobs with dependency injection. Runs jobs in topological order.

Install: pip install minidag

Usage:

from minidag import MiniDAG

dag = MiniDAG()

@dag.job()
def job1():
    return 1

@dag.job()
def job2(job1):
    return job1 + 1

@dag.job()
def job3(job1, job2):
    return job1 + job2

@dag.job()
def job4(some_external_value, job3)
    return some_external_value + job3

dag.run(some_external_value=10)
# > {'job1': 1, 'job2': 2, 'job3': 3, 'job4': 13, 'some_external_value': 10}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

minidag-0.1.1.tar.gz (2.4 kB view hashes)

Uploaded Source

Built Distribution

minidag-0.1.1-py3-none-any.whl (2.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page