openepd 6.12.0__py3-none-any.whl → 6.13.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- openepd/__version__.py +1 -1
- openepd/m49/__init__.py +15 -0
- openepd/m49/const.py +1172 -0
- openepd/m49/geo_converter.py +178 -0
- openepd/model/specs/range/furnishings.py +2 -2
- openepd/model/specs/singular/furnishings.py +2 -2
- {openepd-6.12.0.dist-info → openepd-6.13.0.dist-info}/METADATA +1 -1
- {openepd-6.12.0.dist-info → openepd-6.13.0.dist-info}/RECORD +10 -7
- {openepd-6.12.0.dist-info → openepd-6.13.0.dist-info}/LICENSE +0 -0
- {openepd-6.12.0.dist-info → openepd-6.13.0.dist-info}/WHEEL +0 -0
openepd/m49/const.py
ADDED
@@ -0,0 +1,1172 @@
|
|
1
|
+
#
|
2
|
+
# Copyright 2025 by C Change Labs Inc. www.c-change-labs.com
|
3
|
+
#
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
# you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
15
|
+
#
|
16
|
+
|
17
|
+
from typing import NamedTuple
|
18
|
+
|
19
|
+
M49_CODE_WORLD = "001"
|
20
|
+
M49_CODE_AFRICA = "002"
|
21
|
+
M49_CODE_NORTH_AMERICA = "003"
|
22
|
+
M49_CODE_SOUTH_AMERICA = "005"
|
23
|
+
M49_CODE_OCEANIA = "009"
|
24
|
+
M49_CODE_CENTRAL_AMERICA = "013"
|
25
|
+
M49_CODE_ASIA = "142"
|
26
|
+
M49_CODE_EUROPE = "150"
|
27
|
+
|
28
|
+
NORTHERN_AFRICA = {
|
29
|
+
"DZ", # 012 Algeria
|
30
|
+
"EG", # 818 Egypt
|
31
|
+
"LY", # 434 Libya
|
32
|
+
"MA", # 504 Morocco
|
33
|
+
"SD", # 729 Sudan
|
34
|
+
"TN", # 788 Tunisia
|
35
|
+
"EH", # 732 Western Sahara
|
36
|
+
}
|
37
|
+
EASTERN_AFRICA = {
|
38
|
+
"IO", # 086 British Indian Ocean Territory
|
39
|
+
"BI", # 108 Burundi
|
40
|
+
"KM", # 174 Comoros
|
41
|
+
"DJ", # 262 Djibouti
|
42
|
+
"ER", # 232 Eritrea
|
43
|
+
"ET", # 231 Ethiopia
|
44
|
+
"TF", # 260 French Southern Territories
|
45
|
+
"KE", # 404 Kenya
|
46
|
+
"MG", # 450 Madagascar
|
47
|
+
"MW", # 454 Malawi
|
48
|
+
"MU", # 480 Mauritius
|
49
|
+
"YT", # 175 Mayotte
|
50
|
+
"MZ", # 508 Mozambique
|
51
|
+
"RW", # 646 Rwanda
|
52
|
+
"RE", # 638 Réunion
|
53
|
+
"SC", # 690 Seychelles
|
54
|
+
"SO", # 706 Somalia
|
55
|
+
"SS", # 728 South Sudan
|
56
|
+
"UG", # 800 Uganda
|
57
|
+
"TZ", # 834 United Republic of Tanzania
|
58
|
+
"ZM", # 894 Zambia
|
59
|
+
"ZW", # 716 Zimbabwe
|
60
|
+
}
|
61
|
+
MIDDLE_AFRICA = {
|
62
|
+
"AO", # 024 Angola
|
63
|
+
"CM", # 120 Cameroon
|
64
|
+
"CF", # 140 Central African Republic
|
65
|
+
"TD", # 148 Chad
|
66
|
+
"CG", # 178 Congo
|
67
|
+
"CD", # 180 Democratic Republic of the Congo
|
68
|
+
"GQ", # 226 Equatorial Guinea
|
69
|
+
"GA", # 266 Gabon
|
70
|
+
"ST", # 678 Sao Tome and Principe
|
71
|
+
}
|
72
|
+
SOUTHERN_AFRICA = {
|
73
|
+
"BW", # 072 Botswana
|
74
|
+
"SZ", # 748 Eswatini
|
75
|
+
"LS", # 426 Lesotho
|
76
|
+
"NA", # 516 Namibia
|
77
|
+
"ZA", # 710 South Africa
|
78
|
+
}
|
79
|
+
WESTERN_AFRICA = {
|
80
|
+
"BJ", # 204 Benin
|
81
|
+
"BF", # 854 Burkina Faso
|
82
|
+
"CV", # 132 Cabo Verde
|
83
|
+
"CI", # 384 Côte d’Ivoire
|
84
|
+
"GM", # 270 Gambia
|
85
|
+
"GH", # 288 Ghana
|
86
|
+
"GN", # 324 Guinea
|
87
|
+
"GW", # 624 Guinea-Bissau
|
88
|
+
"LR", # 430 Liberia
|
89
|
+
"ML", # 466 Mali
|
90
|
+
"MR", # 478 Mauritania
|
91
|
+
"NE", # 562 Niger
|
92
|
+
"NG", # 566 Nigeria
|
93
|
+
"SH", # 654 Saint Helena
|
94
|
+
"SN", # 686 Senegal
|
95
|
+
"SL", # 694 Sierra Leone
|
96
|
+
"TG", # 768 Togo
|
97
|
+
}
|
98
|
+
SUB_SAHARAN_AFRICA = {
|
99
|
+
*EASTERN_AFRICA,
|
100
|
+
*MIDDLE_AFRICA,
|
101
|
+
*SOUTHERN_AFRICA,
|
102
|
+
*WESTERN_AFRICA,
|
103
|
+
}
|
104
|
+
AFRICA = {
|
105
|
+
*NORTHERN_AFRICA,
|
106
|
+
*SUB_SAHARAN_AFRICA,
|
107
|
+
}
|
108
|
+
CARIBBEAN = {
|
109
|
+
"AI", # 660 Anguilla
|
110
|
+
"AG", # 028 Antigua and Barbuda
|
111
|
+
"AW", # 533 Aruba
|
112
|
+
"BS", # 044 Bahamas
|
113
|
+
"BB", # 052 Barbados
|
114
|
+
"BQ", # 535 Bonaire, Sint Eustatius and Saba
|
115
|
+
"VG", # 092 British Virgin Islands
|
116
|
+
"KY", # 136 Cayman Islands
|
117
|
+
"CU", # 192 Cuba
|
118
|
+
"CW", # 531 Curaçao
|
119
|
+
"DM", # 212 Dominica
|
120
|
+
"DO", # 214 Dominican Republic
|
121
|
+
"GD", # 308 Grenada
|
122
|
+
"GP", # 312 Guadeloupe
|
123
|
+
"HT", # 332 Haiti
|
124
|
+
"JM", # 388 Jamaica
|
125
|
+
"MQ", # 474 Martinique
|
126
|
+
"MS", # 500 Montserrat
|
127
|
+
"PR", # 630 Puerto Rico
|
128
|
+
"BL", # 652 Saint Barthélemy
|
129
|
+
"KN", # 659 Saint Kitts and Nevis
|
130
|
+
"LC", # 662 Saint Lucia
|
131
|
+
"MF", # 663 Saint Martin (French Part)
|
132
|
+
"VC", # 670 Saint Vincent and the Grenadines
|
133
|
+
"SX", # 534 Sint Maarten (Dutch part)
|
134
|
+
"TT", # 780 Trinidad and Tobago
|
135
|
+
"TC", # 796 Turks and Caicos Islands
|
136
|
+
"VI", # 850 United States Virgin Islands
|
137
|
+
}
|
138
|
+
CENTRAL_AMERICA = {
|
139
|
+
"BZ", # 084 Belize
|
140
|
+
"CR", # 188 Costa Rica
|
141
|
+
"SV", # 222 El Salvador
|
142
|
+
"GT", # 320 Guatemala
|
143
|
+
"HN", # 340 Honduras
|
144
|
+
"MX", # 484 Mexico
|
145
|
+
"NI", # 558 Nicaragua
|
146
|
+
"PA", # 591 Panama
|
147
|
+
}
|
148
|
+
SOUTH_AMERICA = {
|
149
|
+
"AR", # 032 Argentina
|
150
|
+
"BO", # 068 Bolivia (Plurinational State of)
|
151
|
+
"BV", # 074 Bouvet Island
|
152
|
+
"BR", # 076 Brazil
|
153
|
+
"CL", # 152 Chile
|
154
|
+
"CO", # 170 Colombia
|
155
|
+
"EC", # 218 Ecuador
|
156
|
+
"FK", # 238 Falkland Islands (Malvinas)
|
157
|
+
"GF", # 254 French Guiana
|
158
|
+
"GY", # 328 Guyana
|
159
|
+
"PY", # 600 Paraguay
|
160
|
+
"PE", # 604 Peru
|
161
|
+
"GS", # 239 South Georgia and the South Sandwich Islands
|
162
|
+
"SR", # 740 Suriname
|
163
|
+
"UY", # 858 Uruguay
|
164
|
+
"VE", # 862 Venezuela (Bolivarian Republic of)
|
165
|
+
}
|
166
|
+
LATIN_AMERICA_AND_THE_CARIBBEAN = {
|
167
|
+
*CARIBBEAN,
|
168
|
+
*CENTRAL_AMERICA,
|
169
|
+
*SOUTH_AMERICA,
|
170
|
+
}
|
171
|
+
NORTHERN_AMERICA = {
|
172
|
+
"BM", # 060 Bermuda
|
173
|
+
"CA", # 124 Canada
|
174
|
+
"GL", # 304 Greenland
|
175
|
+
"PM", # 666 Saint Pierre and Miquelon
|
176
|
+
"US", # 840 United States of America
|
177
|
+
}
|
178
|
+
NORTH_AMERICA = {
|
179
|
+
*CARIBBEAN,
|
180
|
+
*CENTRAL_AMERICA,
|
181
|
+
*NORTHERN_AMERICA,
|
182
|
+
}
|
183
|
+
AMERICAS = {
|
184
|
+
*LATIN_AMERICA_AND_THE_CARIBBEAN,
|
185
|
+
*NORTHERN_AMERICA,
|
186
|
+
*NORTH_AMERICA,
|
187
|
+
}
|
188
|
+
CENTRAL_ASIA = {
|
189
|
+
"KZ", # 398 Kazakhstan
|
190
|
+
"KG", # 417 Kyrgyzstan
|
191
|
+
"TJ", # 762 Tajikistan
|
192
|
+
"TM", # 795 Turkmenistan
|
193
|
+
"UZ", # 860 Uzbekistan
|
194
|
+
}
|
195
|
+
EASTERN_ASIA = {
|
196
|
+
"CN", # 156 China
|
197
|
+
"HK", # 344 China, Hong Kong Special Administrative Region
|
198
|
+
"MO", # 446 China, Macao Special Administrative Region
|
199
|
+
"KP", # 408 Democratic People's Republic of Korea
|
200
|
+
"JP", # 392 Japan
|
201
|
+
"MN", # 496 Mongolia
|
202
|
+
"KR", # 410 Republic of Korea
|
203
|
+
}
|
204
|
+
SOUTH_EASTERN_ASIA = {
|
205
|
+
"BN", # 096 Brunei Darussalam
|
206
|
+
"KH", # 116 Cambodia
|
207
|
+
"ID", # 360 Indonesia
|
208
|
+
"LA", # 418 Lao People's Democratic Republic
|
209
|
+
"MY", # 458 Malaysia
|
210
|
+
"MM", # 104 Myanmar
|
211
|
+
"PH", # 608 Philippines
|
212
|
+
"SG", # 702 Singapore
|
213
|
+
"TH", # 764 Thailand
|
214
|
+
"TL", # 626 Timor-Leste
|
215
|
+
"VN", # 704 Viet Nam
|
216
|
+
}
|
217
|
+
SOUTHERN_ASIA = {
|
218
|
+
"AF", # 004 Afghanistan
|
219
|
+
"BD", # 050 Bangladesh
|
220
|
+
"BT", # 064 Bhutan
|
221
|
+
"IN", # 356 India
|
222
|
+
"IR", # 364 Iran (Islamic Republic of)
|
223
|
+
"MV", # 462 Maldives
|
224
|
+
"NP", # 524 Nepal
|
225
|
+
"PK", # 586 Pakistan
|
226
|
+
"LK", # 144 Sri Lanka
|
227
|
+
}
|
228
|
+
WESTERN_ASIA = {
|
229
|
+
"AM", # 051 Armenia
|
230
|
+
"AZ", # 031 Azerbaijan
|
231
|
+
"BH", # 048 Bahrain
|
232
|
+
"CY", # 196 Cyprus
|
233
|
+
"GE", # 268 Georgia
|
234
|
+
"IQ", # 368 Iraq
|
235
|
+
"IL", # 376 Israel
|
236
|
+
"JO", # 400 Jordan
|
237
|
+
"KW", # 414 Kuwait
|
238
|
+
"LB", # 422 Lebanon
|
239
|
+
"OM", # 512 Oman
|
240
|
+
"QA", # 634 Qatar
|
241
|
+
"SA", # 682 Saudi Arabia
|
242
|
+
"PS", # 275 State of Palestine
|
243
|
+
"SY", # 760 Syrian Arab Republic
|
244
|
+
"TR", # 792 Turkey
|
245
|
+
"AE", # 784 United Arab Emirates
|
246
|
+
"YE", # 887 Yemen
|
247
|
+
}
|
248
|
+
ASIA = {
|
249
|
+
*CENTRAL_ASIA,
|
250
|
+
*EASTERN_ASIA,
|
251
|
+
*SOUTH_EASTERN_ASIA,
|
252
|
+
*SOUTHERN_ASIA,
|
253
|
+
*WESTERN_ASIA,
|
254
|
+
}
|
255
|
+
EASTERN_EUROPE = {
|
256
|
+
"BY", # 112 Belarus
|
257
|
+
"BG", # 100 Bulgaria
|
258
|
+
"CZ", # 203 Czechia
|
259
|
+
"HU", # 348 Hungary
|
260
|
+
"PL", # 616 Poland
|
261
|
+
"MD", # 498 Republic of Moldova
|
262
|
+
"RO", # 642 Romania
|
263
|
+
"RU", # 643 Russian Federation
|
264
|
+
"SK", # 703 Slovakia
|
265
|
+
"UA", # 804 Ukraine
|
266
|
+
}
|
267
|
+
CHANNEL_ISLANDS = {
|
268
|
+
"GG", # 831 Guernsey
|
269
|
+
"JE", # 832 Jersey
|
270
|
+
}
|
271
|
+
NORTHERN_EUROPE = {
|
272
|
+
*CHANNEL_ISLANDS,
|
273
|
+
"DK", # 208 Denmark
|
274
|
+
"EE", # 233 Estonia
|
275
|
+
"FO", # 234 Faroe Islands
|
276
|
+
"FI", # 246 Finland
|
277
|
+
"IS", # 352 Iceland
|
278
|
+
"IE", # 372 Ireland
|
279
|
+
"IM", # 833 Isle of Man
|
280
|
+
"LV", # 428 Latvia
|
281
|
+
"LT", # 440 Lithuania
|
282
|
+
"NO", # 578 Norway
|
283
|
+
"SJ", # 744 Svalbard and Jan Mayen Islands
|
284
|
+
"SE", # 752 Sweden
|
285
|
+
"GB", # 826 United Kingdom of Great Britain and Northern Ireland
|
286
|
+
"AX", # 248 Åland Islands
|
287
|
+
}
|
288
|
+
SOUTHERN_EUROPE = {
|
289
|
+
"AL", # 008 Albania
|
290
|
+
"AD", # 020 Andorra
|
291
|
+
"BA", # 070 Bosnia and Herzegovina
|
292
|
+
"HR", # 191 Croatia
|
293
|
+
"GI", # 292 Gibraltar
|
294
|
+
"GR", # 300 Greece
|
295
|
+
"VA", # 336 Holy See
|
296
|
+
"IT", # 380 Italy
|
297
|
+
"MT", # 470 Malta
|
298
|
+
"ME", # 499 Montenegro
|
299
|
+
"MK", # 807 North Macedonia
|
300
|
+
"PT", # 620 Portugal
|
301
|
+
"SM", # 674 San Marino
|
302
|
+
"RS", # 688 Serbia
|
303
|
+
"SI", # 705 Slovenia
|
304
|
+
"ES", # 724 Spain
|
305
|
+
}
|
306
|
+
WESTERN_EUROPE = {
|
307
|
+
"AT", # 040 Austria
|
308
|
+
"BE", # 056 Belgium
|
309
|
+
"FR", # 250 France
|
310
|
+
"DE", # 276 Germany
|
311
|
+
"LI", # 438 Liechtenstein
|
312
|
+
"LU", # 442 Luxembourg
|
313
|
+
"MC", # 492 Monaco
|
314
|
+
"NL", # 528 Netherlands
|
315
|
+
"CH", # 756 Switzerland
|
316
|
+
}
|
317
|
+
EUROPE = {
|
318
|
+
*EASTERN_EUROPE,
|
319
|
+
*NORTHERN_EUROPE,
|
320
|
+
*SOUTHERN_EUROPE,
|
321
|
+
*WESTERN_EUROPE,
|
322
|
+
}
|
323
|
+
AUSTRALIA_AND_NEW_ZEALAND = {
|
324
|
+
"AU", # 036 Australia
|
325
|
+
"CX", # 162 Christmas Island
|
326
|
+
"CC", # 166 Cocos (Keeling) Islands
|
327
|
+
"HM", # 334 Heard Island and McDonald Islands
|
328
|
+
"NZ", # 554 New Zealand
|
329
|
+
"NF", # 574 Norfolk Island
|
330
|
+
}
|
331
|
+
MELANESIA = {
|
332
|
+
"FJ", # 242 Fiji
|
333
|
+
"NC", # 540 New Caledonia
|
334
|
+
"PG", # 598 Papua New Guinea
|
335
|
+
"SB", # 090 Solomon Islands
|
336
|
+
"VU", # 548 Vanuatu
|
337
|
+
}
|
338
|
+
MICRONESIA = {
|
339
|
+
"GU", # 316 Guam
|
340
|
+
"KI", # 296 Kiribati
|
341
|
+
"MH", # 584 Marshall Islands
|
342
|
+
"FM", # 583 Micronesia (Federated States of)
|
343
|
+
"NR", # 520 Nauru
|
344
|
+
"MP", # 580 Northern Mariana Islands
|
345
|
+
"PW", # 585 Palau
|
346
|
+
"UM", # 581 United States Minor Outlying Islands
|
347
|
+
}
|
348
|
+
POLYNESIA = {
|
349
|
+
"AS", # 016 American Samoa
|
350
|
+
"CK", # 184 Cook Islands
|
351
|
+
"PF", # 258 French Polynesia
|
352
|
+
"NU", # 570 Niue
|
353
|
+
"PN", # 612 Pitcairn
|
354
|
+
"WS", # 882 Samoa
|
355
|
+
"TK", # 772 Tokelau
|
356
|
+
"TO", # 776 Tonga
|
357
|
+
"TV", # 798 Tuvalu
|
358
|
+
"WF", # 876 Wallis and Futuna Islands
|
359
|
+
}
|
360
|
+
OCEANIA = {
|
361
|
+
*AUSTRALIA_AND_NEW_ZEALAND,
|
362
|
+
*MELANESIA,
|
363
|
+
*MICRONESIA,
|
364
|
+
*POLYNESIA,
|
365
|
+
}
|
366
|
+
WORLD = {
|
367
|
+
*AFRICA,
|
368
|
+
*AMERICAS,
|
369
|
+
*ASIA,
|
370
|
+
*EUROPE,
|
371
|
+
*OCEANIA,
|
372
|
+
"AQ", # 010 Antarctica
|
373
|
+
}
|
374
|
+
|
375
|
+
M49_AREAS = {
|
376
|
+
M49_CODE_WORLD: WORLD,
|
377
|
+
M49_CODE_AFRICA: AFRICA,
|
378
|
+
M49_CODE_NORTH_AMERICA: NORTH_AMERICA,
|
379
|
+
M49_CODE_SOUTH_AMERICA: SOUTH_AMERICA,
|
380
|
+
M49_CODE_OCEANIA: OCEANIA,
|
381
|
+
"011": WESTERN_AFRICA,
|
382
|
+
M49_CODE_CENTRAL_AMERICA: CENTRAL_AMERICA,
|
383
|
+
"014": EASTERN_AFRICA,
|
384
|
+
"015": NORTHERN_AFRICA,
|
385
|
+
"017": MIDDLE_AFRICA,
|
386
|
+
"018": SOUTHERN_AFRICA,
|
387
|
+
"019": AMERICAS,
|
388
|
+
"021": NORTHERN_AMERICA,
|
389
|
+
"029": CARIBBEAN,
|
390
|
+
"030": EASTERN_ASIA,
|
391
|
+
"034": SOUTHERN_ASIA,
|
392
|
+
"035": SOUTH_EASTERN_ASIA,
|
393
|
+
"039": SOUTHERN_EUROPE,
|
394
|
+
"053": AUSTRALIA_AND_NEW_ZEALAND,
|
395
|
+
"054": MELANESIA,
|
396
|
+
"057": MICRONESIA,
|
397
|
+
"061": POLYNESIA,
|
398
|
+
M49_CODE_ASIA: ASIA,
|
399
|
+
"143": CENTRAL_ASIA,
|
400
|
+
"145": WESTERN_ASIA,
|
401
|
+
M49_CODE_EUROPE: EUROPE,
|
402
|
+
"151": EASTERN_EUROPE,
|
403
|
+
"154": NORTHERN_EUROPE,
|
404
|
+
"155": WESTERN_EUROPE,
|
405
|
+
"202": SUB_SAHARAN_AFRICA,
|
406
|
+
"419": LATIN_AMERICA_AND_THE_CARIBBEAN,
|
407
|
+
"830": CHANNEL_ISLANDS,
|
408
|
+
}
|
409
|
+
|
410
|
+
M49_TO_ISO3166_ALPHA2 = {
|
411
|
+
"004": "AF", # Afghanistan
|
412
|
+
"008": "AL", # Albania
|
413
|
+
"010": "AQ", # Antarctica
|
414
|
+
"012": "DZ", # Algeria
|
415
|
+
"016": "AS", # American Samoa
|
416
|
+
"020": "AD", # Andorra
|
417
|
+
"024": "AO", # Angola
|
418
|
+
"028": "AG", # Antigua and Barbuda
|
419
|
+
"031": "AZ", # Azerbaijan
|
420
|
+
"032": "AR", # Argentina
|
421
|
+
"036": "AU", # Australia
|
422
|
+
"040": "AT", # Austria
|
423
|
+
"044": "BS", # Bahamas
|
424
|
+
"048": "BH", # Bahrain
|
425
|
+
"050": "BD", # Bangladesh
|
426
|
+
"051": "AM", # Armenia
|
427
|
+
"052": "BB", # Barbados
|
428
|
+
"056": "BE", # Belgium
|
429
|
+
"060": "BM", # Bermuda
|
430
|
+
"064": "BT", # Bhutan
|
431
|
+
"068": "BO", # Bolivia (Plurinational State of)
|
432
|
+
"070": "BA", # Bosnia and Herzegovina
|
433
|
+
"072": "BW", # Botswana
|
434
|
+
"074": "BV", # Bouvet Island
|
435
|
+
"076": "BR", # Brazil
|
436
|
+
"084": "BZ", # Belize
|
437
|
+
"086": "IO", # British Indian Ocean Territory
|
438
|
+
"090": "SB", # Solomon Islands
|
439
|
+
"092": "VG", # British Virgin Islands
|
440
|
+
"096": "BN", # Brunei Darussalam
|
441
|
+
"100": "BG", # Bulgaria
|
442
|
+
"104": "MM", # Myanmar
|
443
|
+
"108": "BI", # Burundi
|
444
|
+
"112": "BY", # Belarus
|
445
|
+
"116": "KH", # Cambodia
|
446
|
+
"120": "CM", # Cameroon
|
447
|
+
"124": "CA", # Canada
|
448
|
+
"132": "CV", # Cabo Verde
|
449
|
+
"136": "KY", # Cayman Islands
|
450
|
+
"140": "CF", # Central African Republic
|
451
|
+
"144": "LK", # Sri Lanka
|
452
|
+
"148": "TD", # Chad
|
453
|
+
"152": "CL", # Chile
|
454
|
+
"156": "CN", # China
|
455
|
+
"162": "CX", # Christmas Island
|
456
|
+
"166": "CC", # Cocos (Keeling) Islands
|
457
|
+
"170": "CO", # Colombia
|
458
|
+
"174": "KM", # Comoros
|
459
|
+
"175": "YT", # Mayotte
|
460
|
+
"178": "CG", # Congo
|
461
|
+
"180": "CD", # Democratic Republic of the Congo
|
462
|
+
"184": "CK", # Cook Islands
|
463
|
+
"188": "CR", # Costa Rica
|
464
|
+
"191": "HR", # Croatia
|
465
|
+
"192": "CU", # Cuba
|
466
|
+
"196": "CY", # Cyprus
|
467
|
+
"203": "CZ", # Czechia
|
468
|
+
"204": "BJ", # Benin
|
469
|
+
"208": "DK", # Denmark
|
470
|
+
"212": "DM", # Dominica
|
471
|
+
"214": "DO", # Dominican Republic
|
472
|
+
"218": "EC", # Ecuador
|
473
|
+
"222": "SV", # El Salvador
|
474
|
+
"226": "GQ", # Equatorial Guinea
|
475
|
+
"231": "ET", # Ethiopia
|
476
|
+
"232": "ER", # Eritrea
|
477
|
+
"233": "EE", # Estonia
|
478
|
+
"234": "FO", # Faroe Islands
|
479
|
+
"238": "FK", # Falkland Islands (Malvinas)
|
480
|
+
"239": "GS", # South Georgia and the South Sandwich Islands
|
481
|
+
"242": "FJ", # Fiji
|
482
|
+
"246": "FI", # Finland
|
483
|
+
"248": "AX", # Åland Islands
|
484
|
+
"250": "FR", # France
|
485
|
+
"254": "GF", # French Guiana
|
486
|
+
"258": "PF", # French Polynesia
|
487
|
+
"260": "TF", # French Southern Territories
|
488
|
+
"262": "DJ", # Djibouti
|
489
|
+
"266": "GA", # Gabon
|
490
|
+
"268": "GE", # Georgia
|
491
|
+
"270": "GM", # Gambia
|
492
|
+
"275": "PS", # State of Palestine
|
493
|
+
"276": "DE", # Germany
|
494
|
+
"288": "GH", # Ghana
|
495
|
+
"292": "GI", # Gibraltar
|
496
|
+
"296": "KI", # Kiribati
|
497
|
+
"300": "GR", # Greece
|
498
|
+
"304": "GL", # Greenland
|
499
|
+
"308": "GD", # Grenada
|
500
|
+
"312": "GP", # Guadeloupe
|
501
|
+
"316": "GU", # Guam
|
502
|
+
"320": "GT", # Guatemala
|
503
|
+
"324": "GN", # Guinea
|
504
|
+
"328": "GY", # Guyana
|
505
|
+
"332": "HT", # Haiti
|
506
|
+
"334": "HM", # Heard Island and McDonald Islands
|
507
|
+
"336": "VA", # Holy See
|
508
|
+
"340": "HN", # Honduras
|
509
|
+
"344": "HK", # China, Hong Kong Special Administrative Region
|
510
|
+
"348": "HU", # Hungary
|
511
|
+
"352": "IS", # Iceland
|
512
|
+
"356": "IN", # India
|
513
|
+
"360": "ID", # Indonesia
|
514
|
+
"364": "IR", # Iran (Islamic Republic of)
|
515
|
+
"368": "IQ", # Iraq
|
516
|
+
"372": "IE", # Ireland
|
517
|
+
"376": "IL", # Israel
|
518
|
+
"380": "IT", # Italy
|
519
|
+
"384": "CI", # Côte d’Ivoire
|
520
|
+
"388": "JM", # Jamaica
|
521
|
+
"392": "JP", # Japan
|
522
|
+
"398": "KZ", # Kazakhstan
|
523
|
+
"400": "JO", # Jordan
|
524
|
+
"404": "KE", # Kenya
|
525
|
+
"408": "KP", # Democratic People's Republic of Korea
|
526
|
+
"410": "KR", # Republic of Korea
|
527
|
+
"414": "KW", # Kuwait
|
528
|
+
"417": "KG", # Kyrgyzstan
|
529
|
+
"418": "LA", # Lao People's Democratic Republic
|
530
|
+
"422": "LB", # Lebanon
|
531
|
+
"426": "LS", # Lesotho
|
532
|
+
"428": "LV", # Latvia
|
533
|
+
"430": "LR", # Liberia
|
534
|
+
"434": "LY", # Libya
|
535
|
+
"438": "LI", # Liechtenstein
|
536
|
+
"440": "LT", # Lithuania
|
537
|
+
"442": "LU", # Luxembourg
|
538
|
+
"446": "MO", # China, Macao Special Administrative Region
|
539
|
+
"450": "MG", # Madagascar
|
540
|
+
"454": "MW", # Malawi
|
541
|
+
"458": "MY", # Malaysia
|
542
|
+
"462": "MV", # Maldives
|
543
|
+
"466": "ML", # Mali
|
544
|
+
"470": "MT", # Malta
|
545
|
+
"474": "MQ", # Martinique
|
546
|
+
"478": "MR", # Mauritania
|
547
|
+
"480": "MU", # Mauritius
|
548
|
+
"484": "MX", # Mexico
|
549
|
+
"492": "MC", # Monaco
|
550
|
+
"496": "MN", # Mongolia
|
551
|
+
"498": "MD", # Republic of Moldova
|
552
|
+
"499": "ME", # Montenegro
|
553
|
+
"500": "MS", # Montserrat
|
554
|
+
"504": "MA", # Morocco
|
555
|
+
"508": "MZ", # Mozambique
|
556
|
+
"512": "OM", # Oman
|
557
|
+
"516": "NA", # Namibia
|
558
|
+
"520": "NR", # Nauru
|
559
|
+
"524": "NP", # Nepal
|
560
|
+
"528": "NL", # Netherlands
|
561
|
+
"531": "CW", # Curaçao
|
562
|
+
"533": "AW", # Aruba
|
563
|
+
"534": "SX", # Sint Maarten (Dutch part)
|
564
|
+
"535": "BQ", # Bonaire, Sint Eustatius and Saba
|
565
|
+
"540": "NC", # New Caledonia
|
566
|
+
"548": "VU", # Vanuatu
|
567
|
+
"554": "NZ", # New Zealand
|
568
|
+
"558": "NI", # Nicaragua
|
569
|
+
"562": "NE", # Niger
|
570
|
+
"566": "NG", # Nigeria
|
571
|
+
"570": "NU", # Niue
|
572
|
+
"574": "NF", # Norfolk Island
|
573
|
+
"578": "NO", # Norway
|
574
|
+
"580": "MP", # Northern Mariana Islands
|
575
|
+
"581": "UM", # United States Minor Outlying Islands
|
576
|
+
"583": "FM", # Micronesia (Federated States of)
|
577
|
+
"584": "MH", # Marshall Islands
|
578
|
+
"585": "PW", # Palau
|
579
|
+
"586": "PK", # Pakistan
|
580
|
+
"591": "PA", # Panama
|
581
|
+
"598": "PG", # Papua New Guinea
|
582
|
+
"600": "PY", # Paraguay
|
583
|
+
"604": "PE", # Peru
|
584
|
+
"608": "PH", # Philippines
|
585
|
+
"612": "PN", # Pitcairn
|
586
|
+
"616": "PL", # Poland
|
587
|
+
"620": "PT", # Portugal
|
588
|
+
"624": "GW", # Guinea-Bissau
|
589
|
+
"626": "TL", # Timor-Leste
|
590
|
+
"630": "PR", # Puerto Rico
|
591
|
+
"634": "QA", # Qatar
|
592
|
+
"638": "RE", # Réunion
|
593
|
+
"642": "RO", # Romania
|
594
|
+
"643": "RU", # Russian Federation
|
595
|
+
"646": "RW", # Rwanda
|
596
|
+
"652": "BL", # Saint Barthélemy
|
597
|
+
"654": "SH", # Saint Helena
|
598
|
+
"659": "KN", # Saint Kitts and Nevis
|
599
|
+
"660": "AI", # Anguilla
|
600
|
+
"662": "LC", # Saint Lucia
|
601
|
+
"663": "MF", # Saint Martin (French Part)
|
602
|
+
"666": "PM", # Saint Pierre and Miquelon
|
603
|
+
"670": "VC", # Saint Vincent and the Grenadines
|
604
|
+
"674": "SM", # San Marino
|
605
|
+
"678": "ST", # Sao Tome and Principe
|
606
|
+
"682": "SA", # Saudi Arabia
|
607
|
+
"686": "SN", # Senegal
|
608
|
+
"688": "RS", # Serbia
|
609
|
+
"690": "SC", # Seychelles
|
610
|
+
"694": "SL", # Sierra Leone
|
611
|
+
"702": "SG", # Singapore
|
612
|
+
"703": "SK", # Slovakia
|
613
|
+
"704": "VN", # Viet Nam
|
614
|
+
"705": "SI", # Slovenia
|
615
|
+
"706": "SO", # Somalia
|
616
|
+
"710": "ZA", # South Africa
|
617
|
+
"716": "ZW", # Zimbabwe
|
618
|
+
"724": "ES", # Spain
|
619
|
+
"728": "SS", # South Sudan
|
620
|
+
"729": "SD", # Sudan
|
621
|
+
"732": "EH", # Western Sahara
|
622
|
+
"740": "SR", # Suriname
|
623
|
+
"744": "SJ", # Svalbard and Jan Mayen Islands
|
624
|
+
"748": "SZ", # Eswatini
|
625
|
+
"752": "SE", # Sweden
|
626
|
+
"756": "CH", # Switzerland
|
627
|
+
"760": "SY", # Syrian Arab Republic
|
628
|
+
"762": "TJ", # Tajikistan
|
629
|
+
"764": "TH", # Thailand
|
630
|
+
"768": "TG", # Togo
|
631
|
+
"772": "TK", # Tokelau
|
632
|
+
"776": "TO", # Tonga
|
633
|
+
"780": "TT", # Trinidad and Tobago
|
634
|
+
"784": "AE", # United Arab Emirates
|
635
|
+
"788": "TN", # Tunisia
|
636
|
+
"792": "TR", # Turkey
|
637
|
+
"795": "TM", # Turkmenistan
|
638
|
+
"796": "TC", # Turks and Caicos Islands
|
639
|
+
"798": "TV", # Tuvalu
|
640
|
+
"800": "UG", # Uganda
|
641
|
+
"804": "UA", # Ukraine
|
642
|
+
"807": "MK", # North Macedonia
|
643
|
+
"818": "EG", # Egypt
|
644
|
+
"826": "GB", # United Kingdom of Great Britain and Northern Ireland
|
645
|
+
"831": "GG", # Guernsey
|
646
|
+
"832": "JE", # Jersey
|
647
|
+
"833": "IM", # Isle of Man
|
648
|
+
"834": "TZ", # United Republic of Tanzania
|
649
|
+
"840": "US", # United States of America
|
650
|
+
"850": "VI", # United States Virgin Islands
|
651
|
+
"854": "BF", # Burkina Faso
|
652
|
+
"858": "UY", # Uruguay
|
653
|
+
"860": "UZ", # Uzbekistan
|
654
|
+
"862": "VE", # Venezuela (Bolivarian Republic of)
|
655
|
+
"876": "WF", # Wallis and Futuna Islands
|
656
|
+
"882": "WS", # Samoa
|
657
|
+
"887": "YE", # Yemen
|
658
|
+
"894": "ZM", # Zambia
|
659
|
+
}
|
660
|
+
|
661
|
+
# reverse mapping from ISO3166 alpha2 to M49
|
662
|
+
ISO3166_ALPHA2_TO_M49 = {v: k for k, v in M49_TO_ISO3166_ALPHA2.items()}
|
663
|
+
|
664
|
+
REGION_VERBOSE_NAME_TO_M49 = {
|
665
|
+
"World": M49_CODE_WORLD,
|
666
|
+
"Africa": M49_CODE_AFRICA,
|
667
|
+
"Northern Africa": "015",
|
668
|
+
"Sub-Saharan Africa": "202",
|
669
|
+
"Eastern Africa": "014",
|
670
|
+
"Middle Africa": "017",
|
671
|
+
"Southern Africa": "018",
|
672
|
+
"Western Africa": "011",
|
673
|
+
"Americas": "019",
|
674
|
+
"Latin America and the Caribbean": "419",
|
675
|
+
"Caribbean": "029",
|
676
|
+
"Central America": M49_CODE_CENTRAL_AMERICA,
|
677
|
+
"South America": M49_CODE_SOUTH_AMERICA,
|
678
|
+
"North America": M49_CODE_NORTH_AMERICA,
|
679
|
+
"Northern America": "021",
|
680
|
+
"Asia": M49_CODE_ASIA,
|
681
|
+
"Central Asia": "143",
|
682
|
+
"Eastern Asia": "030",
|
683
|
+
"South-Eastern Asia": "035",
|
684
|
+
"Southern Asia": "034",
|
685
|
+
"Western Asia": "145",
|
686
|
+
"Europe": M49_CODE_EUROPE,
|
687
|
+
"Eastern Europe": "151",
|
688
|
+
"Northern Europe": "154",
|
689
|
+
"Southern Europe": "039",
|
690
|
+
"Western Europe": "155",
|
691
|
+
"Oceania": M49_CODE_OCEANIA,
|
692
|
+
"Australia and New Zealand": "053",
|
693
|
+
"Melanesia": "054",
|
694
|
+
"Micronesia": "057",
|
695
|
+
"Polynesia": "061",
|
696
|
+
}
|
697
|
+
|
698
|
+
M49_TO_REGION_VERBOSE_NAME = {
|
699
|
+
M49_CODE_WORLD: "World",
|
700
|
+
M49_CODE_AFRICA: "Africa",
|
701
|
+
"015": "Northern Africa",
|
702
|
+
"202": "Sub-Saharan Africa",
|
703
|
+
"014": "Eastern Africa",
|
704
|
+
"017": "Middle Africa",
|
705
|
+
"018": "Southern Africa",
|
706
|
+
"011": "Western Africa",
|
707
|
+
"019": "Americas",
|
708
|
+
"419": "Latin America and the Caribbean",
|
709
|
+
"029": "Caribbean",
|
710
|
+
M49_CODE_CENTRAL_AMERICA: "Central America",
|
711
|
+
M49_CODE_SOUTH_AMERICA: "South America",
|
712
|
+
M49_CODE_NORTH_AMERICA: "North America",
|
713
|
+
"021": "Northern America",
|
714
|
+
"142": "Asia",
|
715
|
+
"143": "Central Asia",
|
716
|
+
"030": "Eastern Asia",
|
717
|
+
"035": "South-Eastern Asia",
|
718
|
+
"034": "Southern Asia",
|
719
|
+
"145": "Western Asia",
|
720
|
+
M49_CODE_EUROPE: "Europe",
|
721
|
+
"151": "Eastern Europe",
|
722
|
+
"154": "Northern Europe",
|
723
|
+
"039": "Southern Europe",
|
724
|
+
"155": "Western Europe",
|
725
|
+
M49_CODE_OCEANIA: "Oceania",
|
726
|
+
"053": "Australia and New Zealand",
|
727
|
+
"054": "Melanesia",
|
728
|
+
"057": "Micronesia",
|
729
|
+
"061": "Polynesia",
|
730
|
+
}
|
731
|
+
|
732
|
+
COUNTRY_VERBOSE_NAME_TO_M49 = {
|
733
|
+
"Afghanistan": "004",
|
734
|
+
"Albania": "008",
|
735
|
+
"Algeria": "012",
|
736
|
+
"Andorra": "020",
|
737
|
+
"Angola": "024",
|
738
|
+
"Antigua and Barbuda": "028",
|
739
|
+
"Argentina": "032",
|
740
|
+
"Armenia": "051",
|
741
|
+
"Australia": "036",
|
742
|
+
"Austria": "040",
|
743
|
+
"Azerbaijan": "031",
|
744
|
+
"Bahamas": "044",
|
745
|
+
"Bahrain": "048",
|
746
|
+
"Bangladesh": "050",
|
747
|
+
"Barbados": "052",
|
748
|
+
"Belarus": "112",
|
749
|
+
"Belgium": "056",
|
750
|
+
"Belize": "084",
|
751
|
+
"Benin": "204",
|
752
|
+
"Bhutan": "064",
|
753
|
+
"Bolivia": "068",
|
754
|
+
"Bosnia and Herzegovina": "070",
|
755
|
+
"Botswana": "072",
|
756
|
+
"Brazil": "076",
|
757
|
+
"Brunei Darussalam": "096",
|
758
|
+
"Bulgaria": "100",
|
759
|
+
"Burkina Faso": "854",
|
760
|
+
"Burundi": "108",
|
761
|
+
"Cabo Verde": "132",
|
762
|
+
"Cambodia": "116",
|
763
|
+
"Cameroon": "120",
|
764
|
+
"Canada": "124",
|
765
|
+
"Central African Republic": "140",
|
766
|
+
"Chad": "148",
|
767
|
+
"Chile": "152",
|
768
|
+
"China": "156",
|
769
|
+
"Colombia": "170",
|
770
|
+
"Comoros": "174",
|
771
|
+
"Congo": "178",
|
772
|
+
"Congo (Democratic Republic of the)": "180",
|
773
|
+
"Costa Rica": "188",
|
774
|
+
"Croatia": "191",
|
775
|
+
"Cuba": "192",
|
776
|
+
"Cyprus": "196",
|
777
|
+
"Czechia": "203",
|
778
|
+
"Denmark": "208",
|
779
|
+
"Djibouti": "262",
|
780
|
+
"Dominica": "212",
|
781
|
+
"Dominican Republic": "214",
|
782
|
+
"Ecuador": "218",
|
783
|
+
"Egypt": "818",
|
784
|
+
"El Salvador": "222",
|
785
|
+
"Equatorial Guinea": "226",
|
786
|
+
"Eritrea": "232",
|
787
|
+
"Estonia": "233",
|
788
|
+
"Eswatini": "748",
|
789
|
+
"Ethiopia": "231",
|
790
|
+
"Fiji": "242",
|
791
|
+
"Finland": "246",
|
792
|
+
"France": "250",
|
793
|
+
"Gabon": "266",
|
794
|
+
"Gambia": "270",
|
795
|
+
"Georgia": "268",
|
796
|
+
"Germany": "276",
|
797
|
+
"Ghana": "288",
|
798
|
+
"Greece": "300",
|
799
|
+
"Grenada": "308",
|
800
|
+
"Guatemala": "320",
|
801
|
+
"Guinea": "324",
|
802
|
+
"Guinea-Bissau": "624",
|
803
|
+
"Guyana": "328",
|
804
|
+
"Haiti": "332",
|
805
|
+
"Honduras": "340",
|
806
|
+
"Hungary": "348",
|
807
|
+
"Iceland": "352",
|
808
|
+
"India": "356",
|
809
|
+
"Indonesia": "360",
|
810
|
+
"Iran": "364",
|
811
|
+
"Iraq": "368",
|
812
|
+
"Ireland": "372",
|
813
|
+
"Israel": "376",
|
814
|
+
"Italy": "380",
|
815
|
+
"Jamaica": "388",
|
816
|
+
"Japan": "392",
|
817
|
+
"Jordan": "400",
|
818
|
+
"Kazakhstan": "398",
|
819
|
+
"Kenya": "404",
|
820
|
+
"Kiribati": "296",
|
821
|
+
"Kuwait": "414",
|
822
|
+
"Kyrgyzstan": "417",
|
823
|
+
"Lao People's Democratic Republic": "418",
|
824
|
+
"Latvia": "428",
|
825
|
+
"Lebanon": "422",
|
826
|
+
"Lesotho": "426",
|
827
|
+
"Liberia": "430",
|
828
|
+
"Libya": "434",
|
829
|
+
"Lithuania": "440",
|
830
|
+
"Luxembourg": "442",
|
831
|
+
"Madagascar": "450",
|
832
|
+
"Malawi": "454",
|
833
|
+
"Malaysia": "458",
|
834
|
+
"Maldives": "462",
|
835
|
+
"Mali": "466",
|
836
|
+
"Malta": "470",
|
837
|
+
"Marshall Islands": "584",
|
838
|
+
"Mauritania": "478",
|
839
|
+
"Mauritius": "480",
|
840
|
+
"Mexico": "484",
|
841
|
+
"Micronesia": "583",
|
842
|
+
"Moldova": "498",
|
843
|
+
"Monaco": "492",
|
844
|
+
"Mongolia": "496",
|
845
|
+
"Montenegro": "499",
|
846
|
+
"Morocco": "504",
|
847
|
+
"Mozambique": "508",
|
848
|
+
"Myanmar": "104",
|
849
|
+
"Namibia": "516",
|
850
|
+
"Nauru": "520",
|
851
|
+
"Nepal": "524",
|
852
|
+
"Netherlands": "528",
|
853
|
+
"New Zealand": "554",
|
854
|
+
"Nicaragua": "558",
|
855
|
+
"Niger": "562",
|
856
|
+
"Nigeria": "566",
|
857
|
+
"North Macedonia": "807",
|
858
|
+
"Norway": "578",
|
859
|
+
"Oman": "512",
|
860
|
+
"Pakistan": "586",
|
861
|
+
"Palau": "585",
|
862
|
+
"Panama": "591",
|
863
|
+
"Papua New Guinea": "598",
|
864
|
+
"Paraguay": "600",
|
865
|
+
"Peru": "604",
|
866
|
+
"Philippines": "608",
|
867
|
+
"Poland": "616",
|
868
|
+
"Portugal": "620",
|
869
|
+
"Qatar": "634",
|
870
|
+
"Republic of Korea": "410",
|
871
|
+
"Republic of Moldova": "498",
|
872
|
+
"Romania": "642",
|
873
|
+
"Russian Federation": "643",
|
874
|
+
"Rwanda": "646",
|
875
|
+
"Saint Kitts and Nevis": "659",
|
876
|
+
"Saint Lucia": "662",
|
877
|
+
"Saint Vincent and the Grenadines": "670",
|
878
|
+
"Samoa": "882",
|
879
|
+
"San Marino": "674",
|
880
|
+
"Sao Tome and Principe": "678",
|
881
|
+
"Saudi Arabia": "682",
|
882
|
+
"Senegal": "686",
|
883
|
+
"Serbia": "688",
|
884
|
+
"Seychelles": "690",
|
885
|
+
"Sierra Leone": "694",
|
886
|
+
"Singapore": "702",
|
887
|
+
"Slovakia": "703",
|
888
|
+
"Slovenia": "705",
|
889
|
+
"Solomon Islands": "090",
|
890
|
+
"Somalia": "706",
|
891
|
+
"South Africa": "710",
|
892
|
+
"South Sudan": "728",
|
893
|
+
"Spain": "724",
|
894
|
+
"Sri Lanka": "144",
|
895
|
+
"Sudan": "729",
|
896
|
+
"Suriname": "740",
|
897
|
+
"Sweden": "752",
|
898
|
+
"Switzerland": "756",
|
899
|
+
"Syrian Arab Republic": "760",
|
900
|
+
"Tajikistan": "762",
|
901
|
+
"Thailand": "764",
|
902
|
+
"Timor-Leste": "626",
|
903
|
+
"Togo": "768",
|
904
|
+
"Tonga": "776",
|
905
|
+
"Trinidad and Tobago": "780",
|
906
|
+
"Tunisia": "788",
|
907
|
+
"Türkiye": "792",
|
908
|
+
"Turkmenistan": "795",
|
909
|
+
"Tuvalu": "798",
|
910
|
+
"Uganda": "800",
|
911
|
+
"Ukraine": "804",
|
912
|
+
"United Arab Emirates": "784",
|
913
|
+
"United Kingdom of Great Britain and Northern Ireland": "826",
|
914
|
+
"United Republic of Tanzania": "834",
|
915
|
+
"United States of America": "840",
|
916
|
+
"Uruguay": "858",
|
917
|
+
"Uzbekistan": "860",
|
918
|
+
"Vanuatu": "548",
|
919
|
+
"Venezuela": "862",
|
920
|
+
"Viet Nam": "704",
|
921
|
+
"Yemen": "887",
|
922
|
+
"Zambia": "894",
|
923
|
+
"Zimbabwe": "716",
|
924
|
+
}
|
925
|
+
|
926
|
+
M49_TO_COUNTRY_VERBOSE_NAME = {
|
927
|
+
"004": "Afghanistan",
|
928
|
+
"008": "Albania",
|
929
|
+
"012": "Algeria",
|
930
|
+
"020": "Andorra",
|
931
|
+
"024": "Angola",
|
932
|
+
"028": "Antigua and Barbuda",
|
933
|
+
"032": "Argentina",
|
934
|
+
"051": "Armenia",
|
935
|
+
"036": "Australia",
|
936
|
+
"040": "Austria",
|
937
|
+
"031": "Azerbaijan",
|
938
|
+
"044": "Bahamas",
|
939
|
+
"048": "Bahrain",
|
940
|
+
"050": "Bangladesh",
|
941
|
+
"052": "Barbados",
|
942
|
+
"112": "Belarus",
|
943
|
+
"056": "Belgium",
|
944
|
+
"084": "Belize",
|
945
|
+
"204": "Benin",
|
946
|
+
"064": "Bhutan",
|
947
|
+
"068": "Bolivia",
|
948
|
+
"070": "Bosnia and Herzegovina",
|
949
|
+
"072": "Botswana",
|
950
|
+
"076": "Brazil",
|
951
|
+
"096": "Brunei Darussalam",
|
952
|
+
"100": "Bulgaria",
|
953
|
+
"854": "Burkina Faso",
|
954
|
+
"108": "Burundi",
|
955
|
+
"132": "Cabo Verde",
|
956
|
+
"116": "Cambodia",
|
957
|
+
"120": "Cameroon",
|
958
|
+
"124": "Canada",
|
959
|
+
"140": "Central African Republic",
|
960
|
+
"148": "Chad",
|
961
|
+
"152": "Chile",
|
962
|
+
"156": "China",
|
963
|
+
"170": "Colombia",
|
964
|
+
"174": "Comoros",
|
965
|
+
"178": "Congo",
|
966
|
+
"180": "Congo",
|
967
|
+
"188": "Costa Rica",
|
968
|
+
"191": "Croatia",
|
969
|
+
"192": "Cuba",
|
970
|
+
"196": "Cyprus",
|
971
|
+
"203": "Czechia",
|
972
|
+
"208": "Denmark",
|
973
|
+
"262": "Djibouti",
|
974
|
+
"212": "Dominica",
|
975
|
+
"214": "Dominican Republic",
|
976
|
+
"218": "Ecuador",
|
977
|
+
"818": "Egypt",
|
978
|
+
"222": "El Salvador",
|
979
|
+
"226": "Equatorial Guinea",
|
980
|
+
"232": "Eritrea",
|
981
|
+
"233": "Estonia",
|
982
|
+
"748": "Eswatini",
|
983
|
+
"231": "Ethiopia",
|
984
|
+
"242": "Fiji",
|
985
|
+
"246": "Finland",
|
986
|
+
"250": "France",
|
987
|
+
"266": "Gabon",
|
988
|
+
"270": "Gambia",
|
989
|
+
"268": "Georgia",
|
990
|
+
"276": "Germany",
|
991
|
+
"288": "Ghana",
|
992
|
+
"300": "Greece",
|
993
|
+
"308": "Grenada",
|
994
|
+
"320": "Guatemala",
|
995
|
+
"324": "Guinea",
|
996
|
+
"624": "Guinea-Bissau",
|
997
|
+
"328": "Guyana",
|
998
|
+
"332": "Haiti",
|
999
|
+
"340": "Honduras",
|
1000
|
+
"348": "Hungary",
|
1001
|
+
"352": "Iceland",
|
1002
|
+
"356": "India",
|
1003
|
+
"360": "Indonesia",
|
1004
|
+
"364": "Iran",
|
1005
|
+
"368": "Iraq",
|
1006
|
+
"372": "Ireland",
|
1007
|
+
"376": "Israel",
|
1008
|
+
"380": "Italy",
|
1009
|
+
"388": "Jamaica",
|
1010
|
+
"392": "Japan",
|
1011
|
+
"400": "Jordan",
|
1012
|
+
"398": "Kazakhstan",
|
1013
|
+
"404": "Kenya",
|
1014
|
+
"296": "Kiribati",
|
1015
|
+
"414": "Kuwait",
|
1016
|
+
"417": "Kyrgyzstan",
|
1017
|
+
"418": "Lao People's Democratic Republic",
|
1018
|
+
"428": "Latvia",
|
1019
|
+
"422": "Lebanon",
|
1020
|
+
"426": "Lesotho",
|
1021
|
+
"430": "Liberia",
|
1022
|
+
"434": "Libya",
|
1023
|
+
"440": "Lithuania",
|
1024
|
+
"442": "Luxembourg",
|
1025
|
+
"450": "Madagascar",
|
1026
|
+
"454": "Malawi",
|
1027
|
+
"458": "Malaysia",
|
1028
|
+
"462": "Maldives",
|
1029
|
+
"466": "Mali",
|
1030
|
+
"470": "Malta",
|
1031
|
+
"584": "Marshall Islands",
|
1032
|
+
"478": "Mauritania",
|
1033
|
+
"480": "Mauritius",
|
1034
|
+
"484": "Mexico",
|
1035
|
+
"583": "Micronesia",
|
1036
|
+
"492": "Monaco",
|
1037
|
+
"496": "Mongolia",
|
1038
|
+
"499": "Montenegro",
|
1039
|
+
"504": "Morocco",
|
1040
|
+
"508": "Mozambique",
|
1041
|
+
"104": "Myanmar",
|
1042
|
+
"516": "Namibia",
|
1043
|
+
"520": "Nauru",
|
1044
|
+
"524": "Nepal",
|
1045
|
+
"528": "Netherlands",
|
1046
|
+
"554": "New Zealand",
|
1047
|
+
"558": "Nicaragua",
|
1048
|
+
"562": "Niger",
|
1049
|
+
"566": "Nigeria",
|
1050
|
+
"807": "North Macedonia",
|
1051
|
+
"578": "Norway",
|
1052
|
+
"512": "Oman",
|
1053
|
+
"586": "Pakistan",
|
1054
|
+
"585": "Palau",
|
1055
|
+
"591": "Panama",
|
1056
|
+
"598": "Papua New Guinea",
|
1057
|
+
"600": "Paraguay",
|
1058
|
+
"604": "Peru",
|
1059
|
+
"608": "Philippines",
|
1060
|
+
"616": "Poland",
|
1061
|
+
"620": "Portugal",
|
1062
|
+
"634": "Qatar",
|
1063
|
+
"410": "Republic of Korea",
|
1064
|
+
"498": "Republic of Moldova",
|
1065
|
+
"642": "Romania",
|
1066
|
+
"643": "Russian Federation",
|
1067
|
+
"646": "Rwanda",
|
1068
|
+
"659": "Saint Kitts and Nevis",
|
1069
|
+
"662": "Saint Lucia",
|
1070
|
+
"670": "Saint Vincent and the Grenadines",
|
1071
|
+
"882": "Samoa",
|
1072
|
+
"674": "San Marino",
|
1073
|
+
"678": "Sao Tome and Principe",
|
1074
|
+
"682": "Saudi Arabia",
|
1075
|
+
"686": "Senegal",
|
1076
|
+
"688": "Serbia",
|
1077
|
+
"690": "Seychelles",
|
1078
|
+
"694": "Sierra Leone",
|
1079
|
+
"702": "Singapore",
|
1080
|
+
"703": "Slovakia",
|
1081
|
+
"705": "Slovenia",
|
1082
|
+
"090": "Solomon Islands",
|
1083
|
+
"706": "Somalia",
|
1084
|
+
"710": "South Africa",
|
1085
|
+
"728": "South Sudan",
|
1086
|
+
"724": "Spain",
|
1087
|
+
"144": "Sri Lanka",
|
1088
|
+
"729": "Sudan",
|
1089
|
+
"740": "Suriname",
|
1090
|
+
"752": "Sweden",
|
1091
|
+
"756": "Switzerland",
|
1092
|
+
"760": "Syrian Arab Republic",
|
1093
|
+
"762": "Tajikistan",
|
1094
|
+
"764": "Thailand",
|
1095
|
+
"626": "Timor-Leste",
|
1096
|
+
"768": "Togo",
|
1097
|
+
"776": "Tonga",
|
1098
|
+
"780": "Trinidad and Tobago",
|
1099
|
+
"788": "Tunisia",
|
1100
|
+
"792": "Türkiye",
|
1101
|
+
"795": "Turkmenistan",
|
1102
|
+
"798": "Tuvalu",
|
1103
|
+
"800": "Uganda",
|
1104
|
+
"804": "Ukraine",
|
1105
|
+
"784": "United Arab Emirates",
|
1106
|
+
"826": "United Kingdom of Great Britain and Northern Ireland",
|
1107
|
+
"834": "United Republic of Tanzania",
|
1108
|
+
"840": "United States of America",
|
1109
|
+
"858": "Uruguay",
|
1110
|
+
"860": "Uzbekistan",
|
1111
|
+
"548": "Vanuatu",
|
1112
|
+
"862": "Venezuela",
|
1113
|
+
"704": "Viet Nam",
|
1114
|
+
"887": "Yemen",
|
1115
|
+
"894": "Zambia",
|
1116
|
+
"716": "Zimbabwe",
|
1117
|
+
}
|
1118
|
+
|
1119
|
+
|
1120
|
+
class SpecialRegion(NamedTuple):
|
1121
|
+
"""Special region definition."""
|
1122
|
+
|
1123
|
+
m49_codes: list[str]
|
1124
|
+
|
1125
|
+
|
1126
|
+
OPENEPD_SPECIAL_REGIONS = {
|
1127
|
+
"EU27": SpecialRegion(
|
1128
|
+
m49_codes=[
|
1129
|
+
ISO3166_ALPHA2_TO_M49[cc]
|
1130
|
+
for cc in [
|
1131
|
+
"AT", # Austria, code 040
|
1132
|
+
"BE", # Belgium, code 056
|
1133
|
+
"BG", # Bulgaria, code 100f
|
1134
|
+
"HR", # Croatia, code 191
|
1135
|
+
"CY", # Cyprus, code 196
|
1136
|
+
"CZ", # Czechia, code 203
|
1137
|
+
"DK", # Denmark, code 208
|
1138
|
+
"EE", # Estonia, code 233
|
1139
|
+
"FI", # Finland, code 246
|
1140
|
+
"FR", # France, code 250
|
1141
|
+
"DE", # Germany, code 276
|
1142
|
+
"GR", # Greece, code 300
|
1143
|
+
"HU", # Hungary, code 348
|
1144
|
+
"IE", # Ireland, code 372
|
1145
|
+
"IT", # Italy, code 380
|
1146
|
+
"LV", # Latvia, code 428
|
1147
|
+
"LT", # Lithuania, code 440
|
1148
|
+
"LU", # Luxembourg, code 442
|
1149
|
+
"MT", # Malta, code 470
|
1150
|
+
"NL", # Netherlands, code 528
|
1151
|
+
"PL", # Poland, code 616
|
1152
|
+
"PT", # Portugal, code 620
|
1153
|
+
"RO", # Romania, code 642
|
1154
|
+
"SK", # Slovakia, code 703
|
1155
|
+
"SI", # Slovenia, code 705
|
1156
|
+
"ES", # Spain, code 724
|
1157
|
+
"SE", # Sweden, code 752
|
1158
|
+
]
|
1159
|
+
]
|
1160
|
+
),
|
1161
|
+
"NAFTA": SpecialRegion(m49_codes=["840", "124", "484"]), # US, Canada, Mexico
|
1162
|
+
}
|
1163
|
+
|
1164
|
+
|
1165
|
+
def is_m49_code(to_check: str) -> bool:
|
1166
|
+
"""
|
1167
|
+
Check if passed string is M49 code.
|
1168
|
+
|
1169
|
+
:param to_check: any string
|
1170
|
+
:return: `True` if passed string is M49 code, `False` otherwise
|
1171
|
+
"""
|
1172
|
+
return to_check in M49_AREAS or to_check in M49_TO_ISO3166_ALPHA2
|