Skip to main content

dagron

High-performance DAG execution engine for Python, powered by Rust.

dagron lets you define directed acyclic graphs of tasks and execute them with maximum parallelism, rich observability, and dozens of execution strategies — from simple thread pools to distributed clusters.

The core graph data structure lives in Rust (via PyO3) for zero-copy speed, while the Python layer provides an ergonomic API for building, executing, analyzing, and visualizing your DAGs.

import dagron

dag = (
dagron.DAG.builder()
.add_node("extract")
.add_node("transform")
.add_node("load")
.add_edge("extract", "transform")
.add_edge("transform", "load")
.build()
)

result = dagron.DAGExecutor(dag).execute({
"extract": lambda: fetch_data(),
"transform": lambda: clean(result),
"load": lambda: write_to_db(result),
})

Features

DAG Builder
Fluent builder pattern, from_records, and Pipeline/task decorator for defining DAGs.
Parallel Execution
Thread-pool and async executors with topological scheduling and cost-aware planning.
Incremental Execution
Early-cutoff recomputation — only re-execute what changed.
Caching
Content-addressable Merkle-tree caching with pluggable backends.
Checkpointing
Save progress to disk and resume after failures.
Conditional Execution
Predicate-gated edges that skip branches at runtime.
Dynamic DAGs
Expand the graph at runtime based on node results.
Approval Gates
Human-in-the-loop gates that pause execution until approved.
Resource Scheduling
GPU, CPU, and memory-aware scheduling with blocking acquire/release.
Distributed Execution
Pluggable backends: threads, multiprocessing, Ray, Celery.
Tracing & Profiling
Chrome-compatible execution traces and critical-path analysis.
Graph Analysis
Explain nodes, what-if analysis, lineage tracking, linting, and query DSL.
Contracts
Type contracts across edges validated at build time.
Templates
Parameterized DAG templates with placeholder expansion.
Versioning
Append-only mutation log with time-travel, diffing, and forking.
DataFrames
Schema validation at edge boundaries for pandas/polars pipelines.
Plugins & Hooks
Event-driven plugin system with hook registry and auto-discovery.
Visualization
ASCII, SVG, Mermaid, and live web dashboard.

Getting Started

Install dagron from PyPI:

pip install dagron

Then head to the Getting Started guide.