Building a modern data warehouse with sql server and python , including ElETL processes, data modeling and analytics
# CBK Kenya Economics Warehouse
A data warehouse project built on Kenya's central bank data — monthly currency exchange rates (back to 1993) and interest/policy rates (back to 1991), sourced from the Central Bank of Kenya (CBK). The goal was to take two messy real-world CSVs and turn them into a proper, query-ready warehouse using the medallion (Bronze → Silver → Gold) architecture, then dig into the data for some actual insights about Kenya's economic history.
Everything runs on Python + SQL Server (T-SQL).
## Why this project
Most "beginner portfolio" data projects use datasets that have been cleaned a thousand times before (Titanic, Iris, etc). This one uses raw CBK exports — decades of real government data, complete with typos, inconsistent formatting, blank cells, and a currency (JPY) quoted per 100 units instead of per 1. The point was to practice actually wrangling messy data end-to-end, not just running `df.describe()` on something tidy.
## Architecture
- **Source** — raw CBK CSVs (`datasets/`)
- **Bronze** — raw data loaded as-is (everything as NVARCHAR, no transformations) via Python
- **Silver** — cleaned and standardized: proper dates, typed numeric columns, fixed typos, consistent naming
- **Gold** — business-ready star schema: dimension tables + fact tables, plus wide-format views for easy querying
See `documents/data_flow_diagram.png` and `documents/data_mart(star schema).png` for more detail on how data moves through the layers and how the final star schema is laid out.
## Repo structure
```
datasets/ Raw CBK CSVs (exchange rates + interest rates)
documents/ Architecture, data flow, and star schema diagrams (.drawio + .png)
scripts/
bronze/ Python scripts that load the raw CSVs into SQL Server
silver/ Schema setup, DDL, and stored procedure for the Silver layer
gold/ DDL for dimension/fact tables, wide-format views, and the Gold load stored procedure
checks/ …