Data & Analytics · Case Study · 05 / 06

Cross-Continental
Eco-Economic
Data Pipeline

One analysis-ready dataset combining weather, food prices, energy and economic data for 5 countries, so an analyst can ask a cross-country question without doing the joins by hand.

Python PostgreSQL Flask API Docker Cron 5 Countries 4 Sources
Team & My Role

Built with a 4-person team for Data Engineering Principles & Practice at Johns Hopkins (Spring 2026). I built the infrastructure (Docker setup, scheduled refresh, Flask API) and wrote the product spec.

The Problem

The Data Exists.
It Doesn’t Line Up.

Weather, food prices, energy and economic data are all public. But they come from different sources in different shapes: some monthly, some yearly, some keyed by country name, some by code. An analyst who wants to ask "did a dry year line up with higher rice prices and slower growth?" spends most of their time cleaning and joining files before they can answer it.

Product Goal

One analysis-ready table with one row per country per month, served through an API and refreshed on its own. The analyst starts at the question, not the joins.

Who It's For

  • Commodity risk analyst: wants to predict food-price swings, and currently combines World Bank, food-price and weather CSVs by hand.
  • International policy adviser: wants to compare climate and economic trends across countries to decide where aid goes.
  • Agriculture business PM: wants cross-continental trends for sourcing decisions without running data pipelines themselves.
Key Decisions

Choices That
Shaped the Data.

DecisionWhy
Country code + month as the keyDifferent sources name countries differently. The ISO3 country code plus year-month gives every source one join key and one time scale.
Keep gaps visibleOuter joins keep every record. Missing coverage (for example, no US food-price data) stays as a blank, so a gap in the source never looks like a processing error.
Spread yearly data across monthsEnergy and economic data are yearly. Spreading them evenly across months lets them sit next to monthly weather and food data without inventing seasonal patterns.
5 countries, 2022 onwardUS and Brazil give strong economic and energy coverage; India, the Philippines and Nigeria give food-price coverage and different climate exposure. Starting in 2022 keeps the overlap useful.
Weekly refresh, not real-timeThe sources update slowly. A weekly scheduled job is cheaper and simpler, and plenty for this kind of analysis.
What I Built

Infrastructure
and API.

Pipeline Architecture
Sources · 4 public datasets
Open-Meteo (weather) World Bank (GDP, inflation, population) U.S. EIA (energy) WFP (food prices)
Processing · Python
One loader per source master.py orchestrator Full history backfill Weekly incremental update Deduplication + schema checks
Storage · PostgreSQL 15
master_data (one row per country-month) countries · weather · food_prices · energy · world_bank
API · Flask · 7 endpoints
/api/get_all /api/get_weather /api/get_food_prices /api/get_energy /api/get_world_bank /api/get_countries /api/health
Infrastructure
Docker Compose (database, app, notebook) Weekly cron job API smoke tests Environment-based config
  • One command to run: docker compose up starts the database, loads the full history on first start, then serves the API.
  • Runs on its own: a cron job refreshes the data every Sunday without anyone touching it.
  • Checked: a smoke-test script hits every endpoint after a build.
← Home · All Work · Data Pipeline