Hamilton
Apache Hamilton is a lightweight Python library for building directed acyclic graphs (DAGs) of data transformations. It solves the problem of structuring and managing data transformation code, making it portable and expressive. It is for data scientists, engineers, and teams building ETL pipelines, ML workflows, LLM applications, RAG systems, and BI dashboards.
✨ Key features
- Portable DAGs run anywhere Python runs.
- Expressive DAGs with function modifiers for DRY code.
- Automatic DAG construction from Python functions.
- Data and schema validation with decorators and adapters.
- Built-in UI for visualization, cataloging, and monitoring.
- Separation of DAG definition and execution.
🎯 Use cases
- Build ETL pipelines for data processing.
- Create machine learning feature engineering workflows.
- Develop LLM applications and RAG systems.
- Manage BI dashboard data transformations.
- Track and debug data pipelines with the Hamilton UI.
📦 Installation
🧰 Requirements: Python 3.8+; optional Graphviz for visualizations; optional UI dependencies for the Hamilton UI.
pip install "apache-hamilton[visualization]"
To use the Apache Hamilton UI, install the ui and sdk dependencies:
pip install "apache-hamilton[ui,sdk]"
🚀 Usage
from hamilton import driver
import my_dag
dr = driver.Builder().with_modules(my_dag).build()
dr.execute(["C"])
⚠️ Good to know
Apache Hamilton is an incubating project at the Apache Software Foundation; it is not designed for loops or conditional logic (use Burr for that).
❓ FAQ
What Python versions are supported?
Apache Hamilton supports Python 3.8 and above.
How do I visualize my DAG?
Install the visualization dependency and ensure Graphviz is installed on your system.
Can I use Hamilton with Airflow or FastAPI?
Yes, Hamilton DAGs are portable and can run in any Python environment, including Airflow pipelines and FastAPI servers.
How do I track executions with the Hamilton UI?
Install the UI and SDK dependencies, start the server with hamilton ui, then create a HamiltonTracker and add it to your Builder.
📊 Repository
🤖 Overview, features, install steps and FAQ were generated from the project's README on Sep 4, 2026. Always check the original source before running commands.