Python data analysis tool fetching real GDP, unemployment and inflation data for African countries from the World Bank API
# π African Economic Data Analyzer
A Python data analysis tool that fetches real economic indicators for major African countries using the **World Bank Open Data API**, performs statistical analysis, and generates publication-ready visualizations.
## π What It Does
- Fetches live data: **GDP growth**, **unemployment**, **inflation**, and **population** (2010β2023)
- Countries covered: **Ghana, Nigeria, Kenya, South Africa, Ethiopia**
- Cleans and structures the data with **pandas**
- Generates 4 charts: line trends, bar comparisons, and a heatmap
- Exports raw data to **CSV** for further analysis
## π οΈ Tech Stack
| Tool | Purpose |
|------|---------|
| Python 3.10+ | Core language |
| `requests` | World Bank API calls |
| `pandas` | Data wrangling & analysis |
| `matplotlib` | Chart generation |
| `seaborn` | Styling & heatmaps |
## π Getting Started
```bash
# Clone the repo
git clone
github.com
cd african-economic-analyzer
# Install dependencies
pip install -r requirements.txt
# Run the analyzer
python main.py
```
## π Project Structure
```
african-economic-analyzer/
βββ main.py # Entry point
βββ requirements.txt
βββ src/
β βββ fetch_data.py # World Bank API integration
β βββ analyze.py # Statistical analysis functions
β βββ visualize.py # Chart generation
βββ outputs/ # Generated charts & CSV (auto-created)
```
## π Sample Outputs
| Chart | Description |
|-------|-------------|
| `gdp_growth.png` | GDP growth rate trends (2010β2023) |
| `unemployment_comparison.png` | Latest unemployment rates by country |
| `inflation_trends.png` | Inflation rate trends over time |
| `gdp_heatmap.png` | Average GDP growth by period (heatmap) |
| `raw_data.csv` | Full cleaned dataset |
## π‘ Key Concepts Demonstrated
- RESTful API consumption and response parsing
- Data cleaning and transformation with pandas
- Modular Python project structure
- St β¦