This repository is a reimplementation of the canonical dbt example jaffle_shop. It illustrates data transformations for an ecommerce store.
Data transformations are implemented using the Python library Ibis which allows to define SQL operations that works across backends. By default, it uses duckdb for local development. Hamilton + Ibis provides a Python-centric alternative to dbt (Learn more).
The content and structure aims to match the original dbt jaffle_shop example. On the other hand, Hamilton is just a Python library and is flexible regarding project structure.
data/: samples data; equivalent to seeds/ in the dbt repo.dataflows/staging load raw data and rename columns to avoid naming conflicts; equivalent to models/staging/ in the dbt repo.dataflows/customer_flow.py and dataflows/order_flow.py define data transformations; equivalent to models/customers.sql and models/orders.sql in the dbt repo.run.py specify where to load data from and how to execute dataflows.Generally, you'll notice Hamilton aims to reduce the sprawl of configurations (.yaml) and documentation (.md). Instead, it uses docstrings, type hints, or Python object to couple them to with your code (.py).
create and activate virtual environment
python -m venv venv & . venv/bin/activate
install requirements
pip install -r requirements.txt
execute the Hamilton dataflow
python run.py
Jaffle shop is an example used by many different frameworks, which can ground comparisons between each other.