The World Bank Data Pipeline Python · SQL · PostgreSQL · Tableau
THE QUESTION
When access to electricity improves, do people tend to live longer?
I used World Bank data to explore this question across 30 countries. Then I built a repeatable process to collect the numbers, check them and prepare them for visual analysis.
30countries compared
2000–2023years covered
720country-and-year records
2prepared reports for analysis
02 / SEE THE RESULT
The numbers become a picture.
These are the actual Tableau visuals from my project. Select an image to take a closer look.
DASHBOARD STATUS
Explore the results today. Interactive publishing is next.
The images below are saved Tableau dashboard exports. The interactive Tableau Public version is not published yet.
Working nowMonthly local data refresh and two validated CSV reports.
Available hereFull-size dashboard images and the project’s code.
Next milestonePublish to Tableau Public, then connect online refresh and portfolio image updates.
01
THE BIG PICTURE
Electricity, income and longer lives.
This dashboard brings two comparisons together: changes in electricity access and life expectancy, plus GDP per capita (current US$) and life expectancy in 2023.
How to read it
Each dot is a country. Higher dots mean longer lives or bigger gains in life expectancy. In the lower chart, darker blue means more people have electricity.
→ A visual way to compare countries, spot patterns and ask better questions.
02
A CLOSER LOOK
More electricity. Longer lives?
From 2000 to 2023, countries with bigger gains in electricity access tended to have bigger gains in life expectancy.
How to read it
Further right = a bigger improvement in electricity access. Higher up = a bigger improvement in life expectancy.
A relationship is not proof of cause. Healthcare, income and other factors can also matter.
Source: official World Bank data, 30 selected countries, 2000–2023. GDP per capita is GDP divided by population; these comparisons show association, not causation. Dashboard images are saved snapshots; they do not refresh live on this website.
03 / HOW I BUILT IT
From a messy starting point to a working system.
I built this in stages. Each stage solved a different part of the problem.
01
START WITH THE BASICS
I learned to spot bad data.
I began with a practice dataset containing duplicates, missing values and impossible numbers. I corrected what I could, set questionable records aside and kept the original data.
Result: a cleaner dataset, with a record of every decision.
02
MOVE TO A REAL SOURCE
I connected to the World Bank.
I moved the database from MySQL to PostgreSQL and added Python to download official figures. This added a repeatable way to collect six measures of development, kept separately from the original synthetic learning data.
Result: official data for 30 countries across 24 years.
03
BUILD IN QUALITY CHECKS
I checked the data before using it.
The system checks each download before updating the database. It also checks the two report files before replacing the previous versions.
Result: checks that help stop incomplete or invalid reports.
04
MAKE IT UNDERSTANDABLE
I turned tables into dashboards.
I used SQL to prepare comparisons and Tableau to draw the charts above. The visuals make it easier to see how electricity, income and life expectancy relate.
Result: patterns people can explore without reading code.
05
REMOVE REPETITIVE WORK
I scheduled it and added alerts.
Windows Task Scheduler runs the data process monthly on my laptop. Each run leaves a written log. If it fails, the system attempts to send me a Gmail alert.
Result: less manual work and clearer failure reporting.
06
MAKE IT EASIER TO MAINTAIN
I added tests and sensible cleanup.
An 18-test suite checks how the code handles success, failure and cleanup. GitHub runs these tests after code changes. Optional cleanup removes old files while keeping recent history.
Result: changes are checked, and old files stay manageable.
✓
WHERE THE PROJECT IS TODAY
A repeatable route from public data to clear insights.
I verified successful runs, tested deliberate failures and received the email alerts. The data process is automated; refreshing Tableau and publishing new dashboard images remain separate steps.
THE PART THAT TAUGHT ME THE MOST
Making it work is one step. Making it dependable takes practice.
From practice to real data
The project began with deliberately messy synthetic records. Moving to the World Bank API meant checking coverage and keeping official observations separate from practice findings.
Planning for failures
I tested failed database and report steps, preserved previous reports when their export failed, and added logs and email alerts to make problems easier to investigate.
Automation has conditions
A missed monthly run taught me to account for sleep and power settings. Updating a CSV also does not automatically publish a Tableau dashboard—each part needs its own checks.
Explore the work behind the charts
Follow the implementation, inspect the outputs, or see how the scheduled run is configured.
Collection & storage: Python downloads six indicators through the World Bank API. Each run keeps a dated copy. PostgreSQL validates and updates the data inside a transaction.
Reports & tests: Two CSV reports are checked before individual replacement. If the second export fails, the first may already be updated. The 18 offline tests cover pipeline behaviour, failure alerts and cleanup. GitHub Actions checks code; it does not run the live monthly data refresh.
Retention: Optional cleanup considers logs older than 90 days and snapshots older than 180 days, keeping the newest three matching entries of each type. It preserves Git-tracked files and unexpected folder contents. Preview mode shows what would be removed.
Limits: The scheduled task needs the configured laptop awake and connected to power, the user logged on, and database and internet access available. An email alert cannot detect a laptop that is off or a task that never starts.
I’m Khaya, a data engineering intern at GOLDENLOOP.
I enjoy taking a question, working through the messy information behind it and building something people can use. This project shows how I learn: start small, understand each step, then improve it.