Portable and expressive data transformation DAGs in plain Python
open sourceApache-2.0self-hostablefreeMCP
Apache Hamilton is a lightweight Python library for directed acyclic graphs (DAGs) of data transformations. You write ordinary Python functions whose parameter names refer to other functions, and Hamilton builds the DAG from them, so the code is modular, testable and can always be visualized. A DAG runs anywhere Python runs: a script, a notebook, an Apache Airflow task or a FastAPI server, and it can scale out on Ray, Dask or Spark. It has data validation, caching, materialization and lineage, and the optional Hamilton UI catalogs, visualizes and monitors runs, locally or deployed with Docker. It also ships an MCP server that lets coding agents scaffold, validate and run DAGs. Hamilton is undergoing incubation at the Apache Software Foundation; its sister library Burr handles loops and conditional logic for agents.
Problems it solves
- my pandas feature engineering code has grown into one huge script nobody can test or follow
- reuse the same data transformation code in a notebook, a batch job and a web service
- see which function produced each column and how my pipeline's steps depend on each other
- structure ETL and ML pipeline code so it's modular and unit-testable
- track lineage and catch data quality problems in a Python dataflow
Features
- DAGs built from plain Python functions and their parameter names
- runs in scripts, notebooks, Airflow, FastAPI and more
- visualization of the DAG (with Graphviz)
- data validation, caching and materialization
- scale out on Ray, Dask or Spark
- Hamilton UI to catalog, visualize and monitor runs
- MCP server for coding agents
- VS Code language server and extension
- Jupyter notebook magic commands
Capabilities
| Has a command line tool | plan not known |
|---|---|
| Has an MCP server | plan not known |
| Takes plugins | plan not known |
| Has official SDKs | plan not known |
