ledger: GDP(nominal) by country table (222 rows) scraped from Wikipedia
This commit is contained in:
1 parent
fe4ef9f102
commit
589e006ece
2 files changed
+269
No files matched your search
@@ -0,0 +1,223 @@
|
||||
Country/Territory,IMF(2026),World Bank(2025),United Nations(2024)
|
||||
World,"128,003,776","118,350,166","111,565,144"
|
||||
United States,"32,642,373","30,769,700","29,298,000"
|
||||
China[n 1],"21,546,403","19,498,039","18,743,802"
|
||||
Germany,"5,471,299","5,050,923","4,659,929"
|
||||
Japan,"4,341,986","4,435,163","4,026,211"
|
||||
United Kingdom,"4,268,446","4,002,588","3,685,881"
|
||||
India,"4,060,207","3,956,067","3,952,244"
|
||||
France,"3,554,155","3,366,316","3,160,443"
|
||||
Russia,"2,861,156","2,561,310","2,173,386"
|
||||
Italy,"2,701,737","2,551,557","2,380,825"
|
||||
Brazil,"2,654,761","2,279,920","2,185,822"
|
||||
Canada,"2,490,256","2,319,900","2,270,076"
|
||||
South Korea,"2,245,847","1,872,375","1,875,388"
|
||||
Mexico,"2,176,236","1,832,641","1,852,723"
|
||||
Australia,"2,110,657","1,798,519","1,830,610"
|
||||
Spain,"2,085,276","1,906,453","1,722,746"
|
||||
Turkey,"1,817,987","1,597,293","1,323,255"
|
||||
Indonesia,"1,479,954","1,445,643","1,396,300"
|
||||
Netherlands,"1,423,856","1,332,768","1,214,928"
|
||||
Saudi Arabia,"1,343,346","1,276,943","1,254,141"
|
||||
Switzerland,"1,135,739","1,043,530","936,564"
|
||||
Poland,"1,133,088","1,035,492","914,696"
|
||||
Taiwan[n 3],"1,019,696",—N/a
|
||||
Belgium,"772,699","725,466","664,564"
|
||||
Argentina,"768,206","683,098","638,365"
|
||||
Israel,"746,982","610,778","542,286"
|
||||
Sweden,"745,081","668,999","604,899"
|
||||
Ireland,"709,972","721,701","577,389"
|
||||
Singapore,"667,889","603,870","547,387"
|
||||
United Arab Emirates,"661,018","552,325 (2024)","552,325"
|
||||
Norway,"651,712","530,756","483,593"
|
||||
Austria,"616,896","579,470","534,791"
|
||||
Thailand,"599,115","577,010","526,518"
|
||||
Colombia,"572,735","457,410","418,542"
|
||||
Malaysia,"547,100","472,193","421,972"
|
||||
Vietnam,"542,130","514,697","476,388"
|
||||
Bangladesh,"506,357","456,319","432,742"
|
||||
Philippines,"501,692","487,086","461,618"
|
||||
Denmark,"499,354","462,527","424,525"
|
||||
South Africa,"489,083","427,184","401,145"
|
||||
Romania,"470,091","428,678","382,770"
|
||||
Hong Kong[n 4],"455,156","427,310","406,863"
|
||||
Pakistan,"450,134","407,307","379,120"
|
||||
Egypt,"442,886","365,255","306,907"
|
||||
Czech Republic,"427,953","391,027","345,037"
|
||||
Chile,"402,243","357,371","330,267"
|
||||
Peru,"399,593","334,855","289,329"
|
||||
Kazakhstan,"397,921","306,239","291,480"
|
||||
Nigeria,"386,671","290,794","252,084"
|
||||
Portugal,"375,197","346,640","313,271"
|
||||
Finland,"338,564","317,039","298,697"
|
||||
Algeria,"331,894","287,031","266,972"
|
||||
Iran,"311,950","362,682","448,092"
|
||||
Greece,"304,627","280,636","257,145"
|
||||
New Zealand,"273,395","264,057","260,172"
|
||||
Hungary,"265,911","246,490","222,905"
|
||||
Cuba,—N/a,"107,352 (2020)","252,063"
|
||||
Iraq,"245,234","254,367","279,641"
|
||||
Ukraine[n 5],"229,406","214,233","190,741"
|
||||
Qatar,"203,044","215,560","219,163"
|
||||
Morocco,"195,632","182,374","160,606"
|
||||
Uzbekistan,"178,167","147,038","114,965"
|
||||
Slovakia,"167,062","154,530","141,776"
|
||||
Angola,"157,297","122,175","117,159"
|
||||
Kenya,"151,151","135,941","120,340"
|
||||
Kuwait,"146,911","157,209","160,227"
|
||||
Bulgaria,"146,507","130,777","113,343"
|
||||
Dominican Republic,"146,362","127,407","124,282"
|
||||
Ecuador,"138,199","130,321","124,676"
|
||||
Puerto Rico,"133,222","129,368","125,842"
|
||||
Guatemala,"132,270","123,306","113,200"
|
||||
Ghana,"128,638","114,210","82,938"
|
||||
Ethiopia,"127,145","126,359","142,275"
|
||||
DR Congo,"122,281","91,031","75,322"
|
||||
Oman,"121,397","109,605","107,137"
|
||||
Croatia,"115,915","105,060","92,662"
|
||||
Ivory Coast,"112,115","99,774","85,894"
|
||||
Serbia,"112,025","99,953","89,074"
|
||||
Venezuela,"111,303","99,661","150,494"
|
||||
Luxembourg,"110,417","101,158","93,280"
|
||||
Costa Rica,"109,931","102,905","95,350"
|
||||
Sri Lanka,"98,964 (2024)","108,825","98,714"
|
||||
Lithuania,"105,907","95,210","84,869"
|
||||
Belarus,"102,042","93,397","75,962"
|
||||
Uruguay,"96,092","85,348","80,962"
|
||||
Panama,"95,024","90,463","86,260"
|
||||
Tanzania[n 6],"94,889","90,143","79,236"
|
||||
Slovenia,"86,732","79,648","72,485"
|
||||
Myanmar,"83,832","81,666","64,796"
|
||||
Turkmenistan,"83,065","49,829","68,655"
|
||||
Bolivia,"80,743","64,769","46,627"
|
||||
Azerbaijan,"78,372","75,938","74,316"
|
||||
Uganda,"73,370","61,986","56,369"
|
||||
Cameroon,"65,135","58,933","53,297"
|
||||
Jordan,"64,909","61,610","53,352"
|
||||
Tunisia,"60,745","57,503","53,493"
|
||||
Paraguay,"60,542","49,278","44,739"
|
||||
Zimbabwe,"56,713","51,216","45,719"
|
||||
Macau[n 7],"54,228","52,061","49,467"
|
||||
Latvia,"53,686","48,619","43,684"
|
||||
Libya,"52,453","48,099","48,484"
|
||||
Cambodia,"52,379","51,267","45,913"
|
||||
Estonia,"51,634","47,031","42,765"
|
||||
Bahrain,"48,849","48,966","47,110"
|
||||
Nepal,"45,844","45,490","42,692"
|
||||
Cyprus[n 8],"45,171","41,226","37,635"
|
||||
Sudan,"44,688","60,163","25,574"
|
||||
Iceland,"43,800","38,583","33,222"
|
||||
Georgia[n 9],"42,716","38,144","34,192"
|
||||
Honduras,"41,505","39,601","37,094"
|
||||
Zambia,"41,243","28,880","25,303"
|
||||
Senegal,"40,469","37,007","36,715"
|
||||
El Salvador,"39,838","36,708","35,365"
|
||||
Haiti,"39,180","32,077","25,312"
|
||||
Bosnia and Herzegovina,"36,771","32,600","30,478"
|
||||
Lebanon,"34,497 (2025)","25,972 (2024)","37,990"
|
||||
Papua New Guinea,"34,403","32,499","32,262"
|
||||
Guyana,"33,961","27,097","24,659"
|
||||
Mali,"33,847","30,069","26,588"
|
||||
Albania,"33,333","30,540","27,037"
|
||||
Burkina Faso,"32,513","27,627","23,250"
|
||||
Armenia,"31,873","29,243","25,955"
|
||||
Malta,"30,712","27,772","25,030"
|
||||
Guinea,"29,930","28,346","36,465"
|
||||
Mongolia,"28,450","25,369","23,586"
|
||||
Benin,"27,786","24,566","21,483"
|
||||
Trinidad and Tobago,"26,836","25,943","25,634"
|
||||
Chad,"25,628","21,473","19,906"
|
||||
Niger,"24,813","21,646","17,491"
|
||||
Nicaragua,"24,227","22,237","19,694"
|
||||
Kyrgyzstan,"23,606","22,624","17,478"
|
||||
Gabon,"23,363","21,427","20,867"
|
||||
Mozambique,"23,275","22,338","22,745"
|
||||
Jamaica,"23,028","22,705","22,014"
|
||||
Botswana,"21,937","19,928","19,401"
|
||||
Moldova[n 10],"21,889","20,352","18,200"
|
||||
North Macedonia,"21,605","19,101","16,952"
|
||||
Madagascar,"21,185","19,620","17,421"
|
||||
Tajikistan,"20,418","17,661","13,949"
|
||||
Afghanistan,"19,662 (2025)","17,779 (2024)","18,283"
|
||||
Laos,"18,959","18,303","16,129"
|
||||
Rwanda,"18,673","16,372","15,111"
|
||||
Malawi,"18,309","14,918","11,734"
|
||||
Namibia,"17,314","15,080","13,372"
|
||||
Syria,"60,043 (2010)","23,738 (2022)","17,254"
|
||||
North Korea,—N/a,—N/a,"17,199"
|
||||
Palestine[n 11][n 12],"16,017 (2024)","17,167","16,017"
|
||||
Mauritius,"17,119","16,158","14,953"
|
||||
Bahamas,"17,042","15,833 (2024)","15,833"
|
||||
Congo,"17,028","16,307","16,412"
|
||||
Brunei,"16,863","15,032","15,463"
|
||||
Mauritania,"14,352","11,680","10,912"
|
||||
Somalia,"14,174","12,995","11,966"
|
||||
Kosovo,"14,053","12,456","11,154"
|
||||
Equatorial Guinea,"13,722","12,823","12,288"
|
||||
Togo,"13,437","11,890","10,163"
|
||||
Channel Islands,—N/a,"12,507 (2023)",—N/a
|
||||
Monaco,—N/a,"11,126 (2024)","11,126"
|
||||
Montenegro,"10,227","9,233","8,274"
|
||||
Liechtenstein,"9,442","8,906 (2024)","8,628"
|
||||
Bermuda,—N/a,"9,194 (2024)","8,840"
|
||||
New Caledonia,—N/a,"8,549 (2024)","8,549"
|
||||
Barbados,"8,483","8,017","7,598"
|
||||
Sierra Leone,"8,270","7,464","6,792"
|
||||
Burundi,"8,137","3,365","4,431"
|
||||
Maldives,"8,130","7,741","7,062"
|
||||
Cayman Islands,—N/a,"7,765 (2024)","7,657"
|
||||
Isle of Man,—N/a,"7,576 (2023)",—N/a
|
||||
Yemen,"7,435","21,606 (2018)","14,304"
|
||||
Guam,—N/a,"6,910 (2022)",—N/a
|
||||
Fiji,"6,352","6,198","5,968"
|
||||
French Polynesia,—N/a,"6,324 (2024)","6,323"
|
||||
South Sudan,"6,069","11,998 (2015)","3,522"
|
||||
Suriname,"5,908","4,524","4,435"
|
||||
Eswatini,"5,792","5,161","4,947"
|
||||
Liberia,"5,642","5,246","5,251"
|
||||
Andorra,"4,879","4,501","4,040"
|
||||
Djibouti,"4,725","4,625","4,152"
|
||||
U.S. Virgin Islands,—N/a,"4,672 (2022)",—N/a
|
||||
Aruba,"4,671","4,168 (2024)","4,192"
|
||||
Faroe Islands,—N/a,"4,053 (2024)",—N/a
|
||||
Bhutan,"3,856","3,579","3,347"
|
||||
Curaçao,—N/a,"3,561 (2024)","3,561"
|
||||
Central African Republic,"3,492","3,066","2,752"
|
||||
Greenland,—N/a,"3,327 (2023)","3,466"
|
||||
Belize,"3,450","3,327","3,204"
|
||||
Cape Verde,"3,448","3,057","2,768"
|
||||
Guinea-Bissau,"2,985","2,528","2,008"
|
||||
Lesotho,"2,972","2,574","2,391"
|
||||
Gambia,"2,792","2,594","2,372"
|
||||
Saint Lucia,"2,765","2,656","2,574"
|
||||
Zanzibar,—N/a,—N/a,"2,530"
|
||||
San Marino,"2,417","2,027 (2023)","2,082"
|
||||
Antigua and Barbuda,"2,385","2,338","2,162"
|
||||
Seychelles,"2,251","2,387","2,162"
|
||||
Timor-Leste,"2,170","1,902","1,866"
|
||||
Eritrea,"1,982 (2019)","2,065 (2011)","1,917"
|
||||
Sint Maarten,—N/a,"1,888","1,670"
|
||||
Solomon Islands,"1,836","1,750","1,584"
|
||||
British Virgin Islands,—N/a,—N/a,"1,830"
|
||||
Comoros,"1,814","1,815","1,567"
|
||||
Turks and Caicos Islands,—N/a,"1,745 (2024)","1,757"
|
||||
Grenada,"1,483","1,420","1,372"
|
||||
Vanuatu,"1,396","1,354","1,092"
|
||||
Samoa,"1,376","1,288","1,253"
|
||||
Saint Vincent and the Grenadines,"1,236","1,255","1,136"
|
||||
São Tomé and Príncipe,"1,161",981,828
|
||||
Saint Kitts and Nevis,"1,143","1,184","1,122"
|
||||
Northern Mariana Islands,—N/a,"1,096 (2022)",—N/a
|
||||
American Samoa,—N/a,871 (2022),—N/a
|
||||
Dominica,791,724,689
|
||||
Tonga,716,679,648
|
||||
Saint Martin,—N/a,649 (2021),—N/a
|
||||
Federated States of Micronesia,521,502,471
|
||||
Anguilla,—N/a,—N/a,456
|
||||
Cook Islands,—N/a,—N/a,414
|
||||
Kiribati,401,349,343
|
||||
Palau,377,345,310
|
||||
Marshall Islands,342,308,281
|
||||
Nauru,196,176,187
|
||||
Montserrat,—N/a,—N/a,81
|
||||
Tuvalu,65,57,56
|
||||
|
@@ -0,0 +1,46 @@
|
||||
import csv, re, sys
|
||||
|
||||
PATH = sys.argv[1] if len(sys.argv) > 1 else '/root/troupe-standup/wizard-work/ledger/gdp_nominal.csv'
|
||||
|
||||
with open(PATH, newline='', encoding='utf-8') as f:
|
||||
rows = list(csv.reader(f))
|
||||
|
||||
FAIL = 0
|
||||
def check(cond, msg):
|
||||
global FAIL
|
||||
if not cond:
|
||||
print('FAIL:', msg)
|
||||
FAIL = 1
|
||||
|
||||
check(len(rows) > 0, 'file empty')
|
||||
header = rows[0]
|
||||
check(header == ['Country/Territory', 'IMF(2026)', 'World Bank(2025)', 'United Nations(2024)'],
|
||||
'bad header: ' + str(header))
|
||||
data = rows[1:]
|
||||
check(len(data) == 222, 'expected 222 data rows, got %d' % len(data))
|
||||
|
||||
check(data[0] == ['World', '128,003,776', '118,350,166', '111,565,144'],
|
||||
'bad first row: ' + str(data[0]))
|
||||
check(data[-1] == ['Tuvalu', '65', '57', '56'], 'bad last row: ' + str(data[-1]))
|
||||
|
||||
def find(name):
|
||||
hits = [r for r in data if r[0] == name or name in r[0]]
|
||||
return hits[0] if hits else None
|
||||
|
||||
us = find('United States')
|
||||
check(us is not None and us[1] == '32,642,373', 'US row wrong: ' + str(us))
|
||||
ch = find('China')
|
||||
check(ch is not None and ch[1] == '21,546,403', 'China row wrong: ' + str(ch))
|
||||
de = find('Germany')
|
||||
check(de is not None and de[1] == '5,471,299', 'Germany row wrong: ' + str(de))
|
||||
|
||||
# numeric-ish cells: digits/commas optionally with (year); or an explicit "N/A" marker
|
||||
numpat = re.compile(r'^[\d,]+(\s*\([\d]+\))?$')
|
||||
na_vals = ('', '—', '—N/a', '—N/A', 'N/a', 'N/A', 'n/a', 'NA')
|
||||
bad = [(i, r[0], c) for i, r in enumerate(data) for c in r[1:] if c not in na_vals and not numpat.fullmatch(c)]
|
||||
check(not bad, 'non-numeric numeric-cells: %s' % bad[:3])
|
||||
|
||||
print('header:', header)
|
||||
print('rows:', len(data))
|
||||
print('result:', 'PASS' if FAIL == 0 else 'FAIL')
|
||||
sys.exit(FAIL)
|
||||
Reference in new issue
Block a user