SPB Git forge

spb/countryatlas

Public
20commits 1branches 0releases
268.3 MBsize
maindefault branch
12 days agolast push
TypeScript 57% Python 38.6% JavaScript 3.6% CSS 0.6%

API: currency prefix + formatted_short, home lists with population filter and fastest GDP growth, registry cache invalidation per snapshot

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Simon-Pierre Boucher committed 13 days ago (Sep 11, 2026) parent 3f606ef

1 changed file +12 −5

modified docs/API.md +12 −5
@@ -146,9 +146,10 @@ Two-word combos such as `housing canada` or `canada gdp` also return `country_to
146 146 ```
147 147 GET /home
148 148 ```
149 −`snapshot` (world population / GDP sums, median life expectancy, counts, built_at), `lists` (largest economies, fastest population growth
150 −among countries > 1 M, highest life expectancy, energy transition leaders, highest GDP per capita PPP, lowest unemployment among countries
151 −> 5 M; 8 rows each with provenance), `recent_changes` (12 most severe), `recently_updated`, `featured_indicators`, `trending`.
149 +`snapshot` (world population / GDP sums, median life expectancy, counts, built_at), `lists` (largest economies; fastest GDP growth,
150 +fastest population growth, highest life expectancy and energy transition leaders among countries ≥ 1 M; highest GDP per capita PPP;
151 +lowest unemployment among countries ≥ 5 M — 8 rows each with provenance, `filter_note`), `recent_changes` (12 most severe),
152 +`recently_updated`, `featured_indicators`, `trending`.
152 153
153 154 ### Changes, sources, methodology
154 155 ```
@@ -182,5 +183,11 @@ POST /admin/cache/clear
182 183 close must happen first). Responses are cached in-process per `(run_id, path, query)`; nothing survives a new run id.
183 184 * **Performance** (real snapshot, 2.0 M observations): country overview ≈ 12 ms warm (≈ 170 ms on the very first request while static
184 185 lookups load), rankings ≈ 20 ms, home ≈ 33 ms, map ≈ 4 ms, cached hits ≈ 1 ms.
185 −* **Formatting**: `formatted` strings use the indicator's `format`: currency/number compact (`53.4k`, `1.2T`), percent `3.4 %`, years
186 − `82.1 yrs`, tonnes `5.2 t`, per-1000 `3.2 per 1,000`, per-100k `1.2 per 100k`.
186 +* **Formatting**: `formatted` strings use the indicator's `format`: currency compact with the registry `unit_short` prefix
187 + (`US$53.4k`, `US$1.2T`, `intl $45.3B`), number compact (`41.7M`), percent `3.4 %`, years `82.1 yrs`, tonnes `5.2 t`, per-1000
188 + `3.2 per 1,000`, per-100k `1.2 per 100k`. `formatted_short` is the same value without prefix/unit (`53.4k`, `3.4`) for tight cells.
189 +* **Registry reloads**: the headline list (`topics.yaml`), indicator metadata and groups are re-read from the YAML registry each time a
190 + new snapshot run id is opened (the loaders' `lru_cache` is cleared), so registry edits take effect with the next build.
191 +* **Home lists**: each curated list carries `min_population` and `filter_note` (e.g. `"Countries above 1M inhabitants"`) when a
192 + population floor applies (fastest GDP growth, fastest population growth, highest life expectancy, energy transition leaders: ≥ 1M;
193 + lowest unemployment: ≥ 5M).
187 194