Context

The Global Findex and the World Development Indicators measure how many adults hold an account, alongside inflation, mobile subscriptions and GDP per capita. Nothing here is synthetic: the pipeline queries the live World Bank API.

Problem

Public APIs are not built for pipelines. Responses arrive with quirks, some countries have gaps, and a single failing indicator should not block the others.

Technical choices

  • Mapped extraction. The DAG lists the indicators, then maps one extract task per indicator: if one fails, the others still land.
  • Defensive ingestion. Retries on the API, a fix for a byte-order mark in the responses, and an idempotent load that can run twice without duplicating rows.
  • DuckDB as the warehouse. Zero infrastructure for a project of this size, and dbt runs on it the same way it would on a cloud warehouse.
  • Gaps stay visible. Guinea-Bissau has no Findex coverage; the marts show the gap instead of filling it.

Tests

  • 17 dbt tests, including singular tests for one row per country and year, and percentages between 0 and 100.
  • pytest on the API client, the loader and the DAG, with fixtures so no network is needed.
  • CI on GitHub Actions.

Results

Account ownership, % of adults 15+, from the latest run:

Country 2011 2024 Change
Senegal 5.8 76.5 +70.6 pp
Côte d'Ivoire 34.3 (2014) 57.6 +23.2 pp
Togo 10.2 57.4 +47.2 pp
Mali 8.2 54.7 +46.5 pp
Benin 10.5 51.8 +41.4 pp
Burkina Faso 13.4 51.4 +38.1 pp
Niger 1.5 14.8 +13.3 pp