# Country age profiles and population

Dataset page: https://meplar.com/datasets/country-age-profiles/

Snapshot: 14 October 2026. World Bank countries/economies and overlapping aggregate groups, 1960–2025; chart selects the ten most populous non-aggregate economies in 2025.

Full data CSV: https://meplar.com/downloads/country-age-profiles/v1/country_age_profiles_1960_2025.csv
Chart/summary CSV: https://meplar.com/downloads/country-age-profiles/v1/chart_data.csv
Desktop chart: https://meplar.com/downloads/country-age-profiles/v1/age_profiles.png
Mobile chart: https://meplar.com/downloads/country-age-profiles/v1/age_profiles_mobile.png
Complete package: https://meplar.com/downloads/country-age-profiles/v1/country-age-profiles.zip

## Package layout and reproduction

Extract the ZIP and enter meplar_demographics/. This complete shared pipeline includes both age_profiles/ and electricity_gap/, all frozen raw indicators and country metadata, plus captured provenance. With requirements.txt, run `python clean.py`, then `MPLCONFIGDIR=/tmp/meplar-mpl python build.py`. These commands rebuild both topics offline. Do not run fetch.py for this fixed snapshot. Rendering can depend on library/font versions; the supplied chart hashes identify the reviewed originals.

## Source data and reuse

World Bank indicator metadata identifies CC BY 4.0. Attribution, a license link and identification of changes are required. World Bank additional mandatory terms also apply, including mediation then arbitration: https://datacatalog.worldbank.org/public-licenses#cc-by . Source metadata and captured licensing evidence accompany the ZIP. No World Bank or UN endorsement is implied. Original Meplar charts and code are separate works; no new license for them is asserted here.

## Original source and method notes

## Main finding
Nigeria: 40.5197% aged 0–14 / 3.06954% aged 65+ = 13.2006 children per older adult. United States: 17.0990% / 18.3872% = 0.929941. This is a ratio of population age groups, not children per parent or family size.

## Selection and chart
Select the 10 non-aggregate economies with highest total population in 2025, the latest complete year in this snapshot. All 10 have both age-share measures; none is discarded. They are India, China, United States, Indonesia, Pakistan, Nigeria, Brazil, Bangladesh, Russian Federation, and Ethiopia. Sort these ten by children_per_older_adult descending for display. Both age shares use total population, including ages 15–64, as denominator. Bar axes begin at zero. The ratio uses unrounded shares, so it may not equal ratios calculated from the one-decimal printed labels.

## Indicators and derived variables
- SP.POP.0014.TO.ZS: population ages 0–14 as percent of total population.
- SP.POP.65UP.TO.ZS: population ages 65+ as percent of total population.
- SP.POP.TOTL: total midyear de facto population; used for selection only.
- working_age_pct = 100 − children_pct − older_pct; age band 15–64, not employment status.
- children_per_older_adult = children_pct / older_pct.

Source for age structure: UN Population Division, World Population Prospects, distributed by World Bank WDI. Total population also draws on national statistical agencies and other sources listed by WDI. These are modeled/interpolated estimates, not exact enumerations; 2025 estimates should not be described as a finalized census. No causal or policy inference is established.

Metadata:
https://databank.worldbank.org/metadataglossary/world-development-indicators/series/SP.POP.0014.TO.ZS
https://databank.worldbank.org/metadataglossary/world-development-indicators/series/SP.POP.65UP.TO.ZS
https://databank.worldbank.org/metadataglossary/world-development-indicators/series/SP.POP.TOTL

## Provenance and reuse
Retrieved 2026-10-14 UTC from the World Bank World Development Indicators API, source 2; API last-updated field: 2026-10-08. Original JSON responses and API URLs are in meplar_demographics/raw/ inside the ZIP. Indicator metadata HTML captured at retrieval is in meplar_demographics/provenance/ inside the ZIP.

Every indicator's WDI metadata explicitly identifies its license as CC BY 4.0. Redistribution, including commercial reuse, is permitted with attribution, a license link, and identification of changes. World Bank additional terms also apply: https://datacatalog.worldbank.org/public-licenses#cc-by . License: https://creativecommons.org/licenses/by/4.0/ . No World Bank or UN endorsement is implied. This is aggregated statistical data, not restricted microdata.

Changes: decoded API JSON; mapped World Bank two-character entity IDs through the official country metadata to canonical three-character codes; separated aggregate and non-aggregate entities using region.id == "NA"; outer-joined indicators on entity and year; sorted/pivoted for plotting; calculated explicitly described derived fields. API nulls remain blank CSV cells, never zero. No interpolation, smoothing, winsorization, imputation, or manual numerical edits. Russia is a display abbreviation of Russian Federation. CSV decimals are rounded to 10–12 significant digits; chart labels are rounded further. Full numerical API precision remains in raw JSON.

## Reproduce
From the root of the extracted combined package, install requirements.txt, then run `python clean.py` followed by `MPLCONFIGDIR=/tmp/meplar-mpl python build.py`. These steps use the frozen raw JSON and require no network. `python fetch.py` optionally replaces the raw snapshot with live API values (which may revise published numbers). Captured source metadata and licensing notes are included under provenance/. PNG charts are 2520 pixels wide. Python version at build: 3.12.14.

## CSV conventions
`code`: World Bank canonical three-character entity identifier, not invariably ISO; `name`: source entity name; `aggregate`: True for World Bank aggregate groups and False for economies; `year`: calendar year. Country/economy rows can include territories; aggregate rows overlap and must not be summed. Blank values mean unavailable. The full CSV retains 1960–2025 rows, including years with missing indicators, so joins remain transparent. Charts use only explicitly selected complete observations.

## Phone-first alternative
