Greenhour: Python pipeline, public API and data story (concept… by Aziz PothiwalaGreenhour: Python pipeline, public API and data story (concept… by Aziz Pothiwala

Greenhour: Python pipeline, public API and data story (concept…

Portfolio project
Aziz Pothiwala
Problem
Electricity is not equally clean at all hours: the grid burns more gas when demand peaks and less when wind and nuclear can cover it. That is useful to know, but the data is hard to feel: a number in grams, changing every half hour, different by region.
The brief I set: make the grid's carbon something you can see in the page itself, explain why it moves, and turn it into one decision, "when should I run this?", available as an API.

Decisions

01

The page changes colour with the grid

The hero and page tint come from the selected region's current intensity: deep moss when clean, then ochre, then sooty brown. One ramp, monotonic in lightness so it survives greyscale and colour blindness, with its own dark mode.
02

A hex-tile map instead of a boundary map

The 14 regions are an original cartogram, which avoids boundary-data licences and keeps London from vanishing. Picking a tile retunes the page, forecast, story and planner.
03

One chart that morphs

The story is a single sticky SVG tweened in JavaScript: generation mix becomes the intensity line, then an hour-by-weekday heatmap, then your region's heatmap with the cleanest two hours outlined. The eye follows one dataset through four views.
04

The data check found a bug

The quality report showed 0.5% missing half-hours in every region. The API silently truncates a response that crosses 1 January. The pipeline now splits requests at year boundaries and has a gap-filling pass.

Result

This is a concept project, so there are no client results to report. Here is what exists, what was checked, and what isn’t done.

Shipped and checked

Live site with a region map, scroll story, planner and API docs. If the live feed fails the page says so and falls back to typical values.
10 Vitest tests and 9 pytest tests, strict mypy, ESLint and tsc clean. Data-quality report: no gaps, duplicates or outliers.
Real findings from the 12 months: GB averaged 125 gCO₂/kWh; 3am averaged 115 g against 153 g at 6pm; weekends were about 13% cleaner; running a 2-hour job at the best time of day instead of 6pm would have saved a median 50%.

Not done, or not verified

No Lighthouse run and no committed screenshots in the project repo yet.
The aggregate file is refreshed by running the pipeline, not on a schedule.

Screens

One sticky chart: generation mix by hour of day...
...morphs into an hour-by-weekday heatmap as you scroll.
The planner calls the same public API the docs describe.
The live number and the 48-hour forecast.
The story chart pinned at the top while chapters scroll.
The planner: what are you running, and by when?

0 likes · 0 views · Nov 26, 2026

Built a concept project that turns grid-carbon data into a live story, API, and planner for finding cleaner times to run appliances.

Tags