ledger: top-20 largest economies by nominal GDP 2024
This commit is contained in:
1 parent
d6207c068a
commit
31397cccf8
2 files changed
+72
No files matched your search
@@ -0,0 +1,35 @@
|
||||
# Top 20 largest economies by nominal GDP (2024, IMF WEO)
|
||||
|
||||
- **Source:** FactoData — "Largest economies in the world, 2024"
|
||||
- **URL:** https://factodata.com/largest-economies-in-the-world-2024/
|
||||
- **Data as-of / base year:** 2024
|
||||
- **Base year of the underlying figures:** 2024 (IMF World Economic Outlook, nominal GDP, current US$)
|
||||
- **Page published:** 2024-11-30
|
||||
- **Publisher:** FactoData (factodata.com)
|
||||
- **World total:** 110.06 trillion US$, 100% share
|
||||
|
||||
| Rank | Country | GDP (Trillion US$) | % share in world GDP |
|
||||
|---|---|---|---|
|
||||
| 1 | United States | 29.17 | 26.50% |
|
||||
| 2 | China | 18.27 | 16.60% |
|
||||
| 3 | Germany | 4.71 | 4.28% |
|
||||
| 4 | Japan | 4.07 | 3.70% |
|
||||
| 5 | India | 3.89 | 3.53% |
|
||||
| 6 | United Kingdom | 3.59 | 3.26% |
|
||||
| 7 | France | 3.17 | 2.88% |
|
||||
| 8 | Italy | 2.38 | 2.16% |
|
||||
| 9 | Canada | 2.21 | 2.01% |
|
||||
| 10 | Brazil | 2.19 | 1.99% |
|
||||
| 11 | Russia | 2.18 | 1.98% |
|
||||
| 12 | South Korea | 1.87 | 1.70% |
|
||||
| 13 | Mexico | 1.85 | 1.68% |
|
||||
| 14 | Australia | 1.80 | 1.64% |
|
||||
| 15 | Spain | 1.73 | 1.57% |
|
||||
| 16 | Indonesia | 1.40 | 1.27% |
|
||||
| 17 | Türkiye | 1.34 | 1.22% |
|
||||
| 18 | Netherlands | 1.22 | 1.11% |
|
||||
| 19 | Saudi Arabia | 1.10 | 1.00% |
|
||||
| 20 | Switzerland | 0.94 | 0.86% |
|
||||
| World | 110.06 | 100% |
|
||||
|
||||
*The table is reproduced verbatim from the source page; only row/column formatting was normalized. No figures were altered.*
|
||||
@@ -0,0 +1,37 @@
|
||||
#!/usr/bin/env bash
|
||||
# verify.sh — real test for the ledger top-20 economies extraction.
|
||||
# Exits 0 only if the extracted markdown table is correct. A single bare
|
||||
# command: its own exit code IS the verdict (0 = correct, nonzero = wrong). No fallbacks.
|
||||
set -u
|
||||
|
||||
F="${1:-/root/.hermes/wizard-outputs/ledger/top-20-economies-2024.md}"
|
||||
|
||||
fail() { echo "VERIFY FAIL: $1" >&2; exit 1; }
|
||||
|
||||
[ -s "$F" ] || fail "missing or empty: $F"
|
||||
|
||||
# 1) Source attribution + world total + world share present
|
||||
grep -q "factodata.com" "$F" || fail "source URL missing"
|
||||
grep -q "110.06" "$F" || fail "world total missing"
|
||||
grep -q "100%" "$F" || fail "world share missing"
|
||||
|
||||
# 2) Exactly 20 ranked rows (e.g. "| 1 | United States | ...")
|
||||
RANKED=$(grep -Ec '^\| [0-9]+ \|' "$F")
|
||||
[ "$RANKED" -eq 20 ] || fail "expected 20 ranked rows, found $RANKED"
|
||||
|
||||
# 3) Ranks 1..20 present in order
|
||||
seq 1 20 | while read -r n; do
|
||||
grep -q "| $n |" "$F" || fail "rank $n missing"
|
||||
done
|
||||
|
||||
# 4) Spot-check key cells (rank, country, gdp trillion)
|
||||
grep -qF "United States | 29.17 | 26.50%" "$F" || fail "US row wrong"
|
||||
grep -qF "China | 18.27 | 16.60%" "$F" || fail "China row wrong"
|
||||
grep -qF "India | 3.89 | 3.53%" "$F" || fail "India row wrong"
|
||||
|
||||
# 5) Markdown table header + separator present
|
||||
grep -q '^\| Rank \| Country' "$F" || fail "table header missing"
|
||||
grep -q '^\| ---' "$F" || fail "table separator missing"
|
||||
|
||||
echo "OK: $F" >&2
|
||||
exit 0
|
||||
Reference in new issue
Block a user