Skip to content

Commit 88e85a3

Browse files
Added quick start section and improved Graphviz installation instructions
1 parent 713980c commit 88e85a3

1 file changed

Lines changed: 47 additions & 7 deletions

File tree

README.md

Lines changed: 47 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,39 @@ under the License.
5353
5454
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).
5555

56+
## Quick Start (2 minutes)
57+
58+
Get started with Apache Hamilton in just a few lines of code:
59+
60+
```python
61+
# Step 1: Install (run in terminal)
62+
# pip install sf-hamilton
63+
64+
# Step 2: Define your functions (nodes in the DAG)
65+
def A() -> int:
66+
return 1
67+
68+
def B(A: int) -> int:
69+
return A + 1
70+
71+
# Step 3: Execute the DAG
72+
from hamilton import driver
73+
74+
dr = driver.Driver({}, __name__)
75+
result = dr.execute(["B"])
76+
77+
print(result)
78+
79+
Expected output: {'B': 2}
80+
81+
## What’s happening?
82+
83+
Each function becomes a node in the DAG
84+
Dependencies are defined through function parameters
85+
Hamilton automatically builds and executes the dependency graph
86+
87+
This is the simplest possible pipeline — from here, you can scale to ML workflows, ETL pipelines, and production data systems.
88+
5689
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!
5790

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

71104
# Installation
72105

73-
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.
106+
Apache Hamilton supports Python 3.8+. We include the optional visualization dependency to display our Apache Hamilton DAG. For visualizations, Graphviz needs to be installed on your system separately.
74107

75-
```bash
76108
pip install "sf-hamilton[visualization]"
77-
```
109+
📦 Install Graphviz (required for visualization)
110+
111+
If you want to visualize DAGs, ensure Graphviz is installed on your system:
112+
113+
Mac : brew install graphviz
78114

79-
To use the Apache Hamilton UI, install the `ui` and `sdk` dependencies.
115+
Ubuntu : sudo apt-get install graphviz
116+
117+
Windows : Download and install from: https://graphviz.org/download/
118+
119+
⚠️ Make sure Graphviz is added to your system PATH.
120+
121+
To use the Apache Hamilton UI, install the ui and sdk dependencies:
80122

81-
```bash
82123
pip install "sf-hamilton[ui,sdk]"
83-
```
84124

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

87127
# Why use Apache Hamilton?
88128

0 commit comments

Comments
 (0)