Skip to main content

Python DAG Runner

Python Python Style License: MIT

Python DAG Runner is a Python library for running Directed Acyclic Graphs (DAGs) efficiently. It provides a simple and intuitive interface for defining and executing complex workflows. It uses networkx library to generate directed acyclic graph from the tasks and it's dependencies.

Installation

You can install python-dag-runner library easily using pip:

pip install python-dag-runner

Usage

You can easily define a dag in python-dag-runner using Dag class. Furthermore, task can be defined using Task class. You can easily define dependencies of tasks using the "|=" operator.

from python_dag_runner import Dag, Task

# Create an executable function
def print_task_1():
    """A sample function"""
    print("Task 1 called")

def print_task_1():
    """A sample function"""
    print("Task 2 called")

# Create Task objects
task_1 = Task(name="task one", executable=print_task_1)
task_2 = Task(name="task two", executable=print_task_2)

# Set dependencies of task using bitwise or operator
task_2 |= {task_1}

# Create a DAG by providing name and sequence of tasks
dag = Dag("My first DAG", tasks=[task_1, task_2])

# Initiate execution of Dag using initialize method
dag.initiate()

Download files

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

Source Distribution

python-dag-runner-0.0.3.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_dag_runner-0.0.3-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file python-dag-runner-0.0.3.tar.gz.

File metadata

  • Download URL: python-dag-runner-0.0.3.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for python-dag-runner-0.0.3.tar.gz
Algorithm Hash digest
SHA256 d3a85a120592a80cc88f95a3d11e8c51a3e50ccfa1f10af83c5cf8b3be28b99f
MD5 0bc114279e7ef4bff6730a596a1284df
BLAKE2b-256 00aff6c24f1d444aa3b827310282b3c3cc97959fb2727a4068ff3722f56c58d0

See more details on using hashes here.

File details

Details for the file python_dag_runner-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for python_dag_runner-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6a20c04d893b9635b39999ae1adf7750c651a61564f0b82a320122e3fd0aa887
MD5 638a96d6418be3f07eaf08825232e1b3
BLAKE2b-256 16688436c2ab190a8e2204687438517fab8c0e10dfbc09b7b0f793b4e70a2f4c

See more details on using hashes here.

Supported by

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