Skip to content
64 changes: 57 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,49 @@ under the License.

Apache Hamilton (incubating) is a lightweight Python library for directed acyclic graphs (DAGs) of data transformations. Your DAG is **portable**; it runs anywhere Python runs, whether it's a script, notebook, Airflow pipeline, FastAPI server, etc. Your DAG is **expressive**; Apache Hamilton has extensive features to define and modify the execution of a DAG (e.g., data validation, experiment tracking, remote execution).

## Quick Start (2 minutes)

Get started with Apache Hamilton in just a few lines of code:

```python
Comment thread
Aditya-Deshwal23 marked this conversation as resolved.
# Step 1: Install (run in terminal)

from sf_hamilton import driver
import types

# create a temporary module
module = types.ModuleType("example")

def A() -> int:
Comment thread
Aditya-Deshwal23 marked this conversation as resolved.
return 1

def B(A: int) -> int:
return A + 1

# attach functions to module
module.A = A
module.B = B

# builder pattern
dr = (
driver.Builder()
.with_modules(module)
.build()
)

print(dr.execute(["B"]))

# Expected output: {'B': 2}
Comment thread
Aditya-Deshwal23 marked this conversation as resolved.
```

### What’s happening?

Each function becomes a node in the DAG
Dependencies are defined through function parameters
Hamilton automatically builds and executes the dependency graph

This is the simplest possible pipeline — from here, you can scale to ML workflows, ETL pipelines, LLM workflows, and production data systems.

To create a DAG, write regular Python functions that specify their dependencies with their parameters. As shown below, it results in readable code that can always be visualized. Apache Hamilton loads that definition and automatically builds the DAG for you!

<div align="center">
Expand All @@ -70,19 +113,26 @@ Apache Hamilton brings modularity and structure to any Python application moving

# Installation

Apache Hamilton supports Python 3.8+. We include the optional `visualization` dependency to display our Apache Hamilton DAG. For visualizations, [Graphviz](https://graphviz.org/download/) needs to be installed on your system separately.
Apache Hamilton supports Python 3.9+. We include the optional visualization dependency to display our Apache Hamilton DAG. For visualizations, Graphviz needs to be installed on your system separately.

```bash
pip install "sf-hamilton[visualization]"
```
📦 Install Graphviz (required for visualization)

If you want to visualize DAGs, ensure Graphviz is installed on your system:

To use the Apache Hamilton UI, install the `ui` and `sdk` dependencies.
Mac : brew install graphviz

Ubuntu : sudo apt-get install graphviz

Windows : Download and install from: https://graphviz.org/download/

⚠️ Make sure Graphviz is added to your system PATH.

To use the Apache Hamilton UI, install the ui and sdk dependencies:

```bash
pip install "sf-hamilton[ui,sdk]"
```

To try Apache Hamilton in the browser, visit [www.tryhamilton.dev](https://www.tryhamilton.dev/?utm_source=README)
To try Apache Hamilton in the browser, visit [Try Hamilton](https://www.tryhamilton.dev/?utm_source=README)

# Why use Apache Hamilton?

Expand Down