diff --git a/apps/unified_connector/sources/relief_web.py b/apps/unified_connector/sources/relief_web.py index 9e2c7ca253..83a0292c14 100644 --- a/apps/unified_connector/sources/relief_web.py +++ b/apps/unified_connector/sources/relief_web.py @@ -7,184 +7,266 @@ from django.conf import settings +# NOTE: Generated using scripts/list_relief_web_countries.sh +COUNTRIES_LIST = [ + ("BES", "Bonaire, Saint Eustatius and Saba (The Netherlands)"), + ("MAF", "Saint Martin (France)"), + ("WLF", "Wallis and Futuna (France)"), + ("ARE", "United Arab Emirates"), + ("TLS", "Timor-Leste"), + ("SGP", "Singapore"), + ("SHN", "Saint Helena"), + ("REU", "Réunion (France)"), + ("QAT", "Qatar"), + ("PCN", "Pitcairn Islands"), + ("LUX", "Luxembourg"), + ("KWT", "Kuwait"), + ("JAM", "Jamaica"), + ("GIB", "Gibraltar"), + ("GAB", "Gabon"), + ("FRO", "Faroe Islands (Denmark)"), + ("EAI", "Easter Island (Chile)"), + ("CIV", "Côte d'Ivoire"), + ("CXR", "Christmas Island (Australia)"), + ("TWN", "China - Taiwan Province"), + ("HKG", "China - Hong Kong (Special Administrative Region)"), + ("CHI", "Channel Islands"), + ("CYM", "Cayman Islands"), + ("CAI", "Canary Islands (Spain)"), + ("BRN", "Brunei Darussalam"), + ("VGB", "British Virgin Islands"), + ("COM", "Comoros"), + ("CPV", "Cabo Verde"), + ("BWA", "Botswana"), + ("GHA", "Ghana"), + ("MUS", "Mauritius"), + ("GUY", "Guyana"), + ("GRC", "Greece"), + ("MNG", "Mongolia"), + ("JPN", "Japan"), + ("PNG", "Papua New Guinea"), + ("NZL", "New Zealand"), + ("FSM", "Micronesia (Federated States of)"), + ("COK", "Cook Islands"), + ("WSM", "Samoa"), + ("TON", "Tonga"), + ("TKM", "Turkmenistan"), + ("KAZ", "Kazakhstan"), + ("UZB", "Uzbekistan"), + ("ARG", "Argentina"), + ("MYS", "Malaysia"), + ("CHL", "Chile"), + ("BRA", "Brazil"), + ("ABW", "Aruba (The Netherlands)"), + ("CUW", "Curaçao (The Netherlands)"), + ("AUT", "Austria"), + ("CYP", "Cyprus"), + ("EST", "Estonia"), + ("ECU", "Ecuador"), + ("GEO", "Georgia"), + ("FRA", "France"), + ("LVA", "Latvia"), + ("PRY", "Paraguay"), + ("LTU", "Lithuania"), + ("SVK", "Slovakia"), + ("NLD", "Netherlands"), + ("NOR", "Norway"), + ("RUS", "Russian Federation"), + ("SWE", "Sweden"), + ("SRB", "Serbia"), + ("TTO", "Trinidad and Tobago"), + ("GBR", "United Kingdom of Great Britain and Northern Ireland"), + ("GTM", "Guatemala"), + ("USA", "United States of America"), + ("MDG", "Madagascar"), + ("DJI", "Djibouti"), + ("JOR", "Jordan"), + ("LKA", "Sri Lanka"), + ("HTI", "Haiti"), + ("KEN", "Kenya"), + ("ZWE", "Zimbabwe"), + ("COD", "Democratic Republic of the Congo"), + ("NER", "Niger"), + ("PHL", "Philippines"), + ("TUR", "Türkiye"), + ("NPL", "Nepal"), + ("SYR", "Syrian Arab Republic"), + ("CAF", "Central African Republic"), + ("SOM", "Somalia"), + ("IRQ", "Iraq"), + ("YEM", "Yemen"), + ("PSE", "occupied Palestinian territory"), + ("AFG", "Afghanistan"), + ("BLM", "Saint Barthélemy (France)"), + ("TCA", "Turks and Caicos Islands"), + ("TKL", "Tokelau"), + ("VCT", "Saint Vincent and the Grenadines"), + ("KNA", "Saint Kitts and Nevis"), + ("PRI", "Puerto Rico (The United States of America)"), + ("MNP", "Northern Mariana Islands (The United States of America)"), + ("NFK", "Norfolk Island (Australia)"), + ("NCL", "New Caledonia (France)"), + ("MSR", "Montserrat"), + ("MCO", "Monaco"), + ("MYT", "Mayotte (France)"), + ("MLT", "Malta"), + ("MDV", "Maldives"), + ("LAO", "Lao People's Democratic Republic (the)"), + ("VAT", "Holy See"), + ("GUM", "Guam"), + ("GLI", "Galapagos Islands (Ecuador)"), + ("FLK", "Falkland Islands (Malvinas)"), + ("DMA", "Dominica"), + ("MAC", "China - Macau (Special Administrative Region)"), + ("BHR", "Bahrain"), + ("AZO", "Azores Islands (Portugal)"), + ("ATG", "Antigua and Barbuda"), + ("AIA", "Anguilla"), + ("ALA", "Aland Islands (Finland)"), + ("ZAF", "South Africa"), + ("NAM", "Namibia"), + ("KHM", "Cambodia"), + ("GNB", "Guinea-Bissau"), + ("ERI", "Eritrea"), + ("GNQ", "Equatorial Guinea"), + ("LSO", "Lesotho"), + ("IDN", "Indonesia"), + ("FJI", "Fiji"), + ("KOR", "Republic of Korea"), + ("NRU", "Nauru"), + ("SLB", "Solomon Islands"), + ("TUV", "Tuvalu"), + ("PLW", "Palau"), + ("ALB", "Albania"), + ("BOL", "Bolivia (Plurinational State of)"), + ("BIH", "Bosnia and Herzegovina"), + ("BEL", "Belgium"), + ("SLV", "El Salvador"), + ("DOM", "Dominican Republic"), + ("GMB", "Gambia"), + ("DEU", "Germany"), + ("HUN", "Hungary"), + ("ITA", "Italy"), + ("IRL", "Ireland"), + ("POL", "Poland"), + ("MKD", "the Republic of North Macedonia"), + ("PAN", "Panama"), + ("ROU", "Romania"), + ("PRT", "Portugal"), + ("CHE", "Switzerland"), + ("LIE", "Liechtenstein"), + ("AGO", "Angola"), + ("ZMB", "Zambia"), + ("RWA", "Rwanda"), + ("MRT", "Mauritania"), + ("SEN", "Senegal"), + ("BDI", "Burundi"), + ("ARM", "Armenia"), + ("MLI", "Mali"), + ("SSD", "South Sudan"), + ("EGY", "Egypt"), + ("CMR", "Cameroon"), + ("MEX", "Mexico"), + ("CRI", "Costa Rica"), + ("CHN", "China"), + ("PAK", "Pakistan"), + ("MOZ", "Mozambique"), + ("UKR", "Ukraine"), + ("LBN", "Lebanon"), + ("VUT", "Vanuatu"), + ("LBY", "Libya"), + ("COL", "Colombia"), + ("SXM", "Sint Maarten (The Netherlands)"), + ("ESH", "Western Sahara"), + ("VIR", "United States Virgin Islands"), + ("TGO", "Togo"), + ("SJM", "Svalbard and Jan Mayen Islands"), + ("SUR", "Suriname"), + ("SVN", "Slovenia"), + ("SYC", "Seychelles"), + ("STP", "Sao Tome and Principe"), + ("SMR", "San Marino"), + ("SPM", "Saint Pierre and Miquelon (France)"), + ("LCA", "Saint Lucia"), + ("OMN", "Oman"), + ("ANT", "Netherlands Antilles (The Netherlands)"), + ("MTQ", "Martinique (France)"), + ("MDR", "Madeira (Portugal)"), + ("ILM", "Isle of Man (The United Kingdom of Great Britain and Northern Ireland)"), + ("HMD", "Heard Island and McDonald Islands (Australia)"), + ("GLP", "Guadeloupe (France)"), + ("GRD", "Grenada"), + ("GRL", "Greenland (Denmark)"), + ("PYF", "French Polynesia (France)"), + ("GUF", "French Guiana (France)"), + ("CCK", "Cocos (Keeling) Islands (Australia)"), + ("BTN", "Bhutan"), + ("BMU", "Bermuda"), + ("BRB", "Barbados"), + ("BHS", "Bahamas"), + ("AND", "Andorra"), + ("ASM", "American Samoa"), + ("THA", "Thailand"), + ("AZE", "Azerbaijan"), + ("WLD", "World"), + ("TZA", "United Republic of Tanzania"), + ("SWZ", "Eswatini"), + ("NIC", "Nicaragua"), + ("KGZ", "Kyrgyzstan"), + ("IND", "India"), + ("AUS", "Australia"), + ("NIU", "Niue (New Zealand)"), + ("MHL", "Marshall Islands"), + ("KIR", "Kiribati"), + ("TJK", "Tajikistan"), + ("DZA", "Algeria"), + ("BLR", "Belarus"), + ("BLZ", "Belize"), + ("BGR", "Bulgaria"), + ("HRV", "Croatia"), + ("CAN", "Canada"), + ("CZE", "Czechia"), + ("CUB", "Cuba"), + ("DNK", "Denmark"), + ("FIN", "Finland"), + ("ISL", "Iceland"), + ("PER", "Peru"), + ("MDA", "Moldova"), + ("MNE", "Montenegro"), + ("SAU", "Saudi Arabia"), + ("URY", "Uruguay"), + ("TUN", "Tunisia"), + ("ESP", "Spain"), + ("VEN", "Venezuela (Bolivarian Republic of)"), + ("BEN", "Benin"), + ("PRK", "Democratic People's Republic of Korea"), + ("GIN", "Guinea"), + ("VNM", "Viet Nam"), + ("MWI", "Malawi"), + ("COG", "Congo"), + ("MAR", "Morocco"), + ("SLE", "Sierra Leone"), + ("ISR", "Israel"), + ("ETH", "Ethiopia"), + ("NGA", "Nigeria"), + ("SDN", "Sudan"), + ("BGD", "Bangladesh"), + ("TCD", "Chad"), + ("MMR", "Myanmar"), + ("UGA", "Uganda"), + ("HND", "Honduras"), + ("IRN", "Iran (Islamic Republic of)"), + ("LBR", "Liberia"), + ("BFA", "Burkina Faso"), +] + + COUNTRIES = [ - {"key": "FJI", "label": "Fiji"}, - {"key": "TZA", "label": "Tanzania"}, - {"key": "SAH", "label": "Western Sahara"}, - {"key": "CAN", "label": "Canada"}, - {"key": "USA", "label": "United States of America"}, - {"key": "KAZ", "label": "Kazakhstan"}, - {"key": "UZB", "label": "Uzbekistan"}, - {"key": "PNG", "label": "Bougainville"}, - {"key": "IDN", "label": "Indonesia"}, - {"key": "ARG", "label": "Argentina"}, - {"key": "CHL", "label": "Chile"}, - {"key": "COD", "label": "Democratic Republic of the Congo"}, - {"key": "SOM", "label": "Somalia"}, - {"key": "KEN", "label": "Kenya"}, - {"key": "SDN", "label": "Sudan"}, - {"key": "TCD", "label": "Chad"}, - {"key": "HTI", "label": "Haiti"}, - {"key": "DOM", "label": "Dominican Republic"}, - {"key": "RUS", "label": "Russia"}, - {"key": "BHS", "label": "The Bahamas"}, - {"key": "FLK", "label": "Falkland Islands"}, - {"key": "NOR", "label": "Svalbard"}, - {"key": "GRL", "label": "Greenland"}, - {"key": "ATF", "label": "French Southern and Antarctic Lands"}, - {"key": "TLS", "label": "East Timor"}, - {"key": "ZAF", "label": "South Africa"}, - {"key": "LSO", "label": "Lesotho"}, - {"key": "MEX", "label": "Mexico"}, - {"key": "URY", "label": "Uruguay"}, - {"key": "BRA", "label": "Brazil"}, - {"key": "BOL", "label": "Bolivia"}, - {"key": "PER", "label": "Peru"}, - {"key": "COL", "label": "Colombia"}, - {"key": "PAN", "label": "Panama"}, - {"key": "CRI", "label": "Costa Rica"}, - {"key": "NIC", "label": "Nicaragua"}, - {"key": "HND", "label": "Honduras"}, - {"key": "SLV", "label": "El Salvador"}, - {"key": "GTM", "label": "Guatemala"}, - {"key": "BLZ", "label": "Belize"}, - {"key": "VEN", "label": "Venezuela"}, - {"key": "GUY", "label": "Guyana"}, - {"key": "SUR", "label": "Suriname"}, - {"key": "FRA", "label": "France"}, - {"key": "ECU", "label": "Ecuador"}, - {"key": "PRI", "label": "Puerto Rico"}, - {"key": "JAM", "label": "Jamaica"}, - {"key": "CUB", "label": "Cuba"}, - {"key": "ZWE", "label": "Zimbabwe"}, - {"key": "BWA", "label": "Botswana"}, - {"key": "NAM", "label": "Namibia"}, - {"key": "SEN", "label": "Senegal"}, - {"key": "MLI", "label": "Mali"}, - {"key": "MRT", "label": "Mauritania"}, - {"key": "BEN", "label": "Benin"}, - {"key": "NER", "label": "Niger"}, - {"key": "NGA", "label": "Nigeria"}, - {"key": "CMR", "label": "Cameroon"}, - {"key": "TGO", "label": "Togo"}, - {"key": "GHA", "label": "Ghana"}, - {"key": "CIV", "label": "Ivory Coast"}, - {"key": "GIN", "label": "Guinea"}, - {"key": "GNB", "label": "Guinea Bissau"}, - {"key": "LBR", "label": "Liberia"}, - {"key": "SLE", "label": "Sierra Leone"}, - {"key": "BFA", "label": "Burkina Faso"}, - {"key": "CAF", "label": "Central African Republic"}, - {"key": "COG", "label": "Republic of the Congo"}, - {"key": "GAB", "label": "Gabon"}, - {"key": "GNQ", "label": "Equatorial Guinea"}, - {"key": "ZMB", "label": "Zambia"}, - {"key": "MWI", "label": "Malawi"}, - {"key": "MOZ", "label": "Mozambique"}, - {"key": "SWZ", "label": "Swaziland"}, - {"key": "AGO", "label": "Angola"}, - {"key": "BDI", "label": "Burundi"}, - {"key": "ISR", "label": "Israel"}, - {"key": "LBN", "label": "Lebanon"}, - {"key": "MDG", "label": "Madagascar"}, - {"key": "PSX", "label": "West Bank"}, - {"key": "GMB", "label": "Gambia"}, - {"key": "TUN", "label": "Tunisia"}, - {"key": "DZA", "label": "Algeria"}, - {"key": "JOR", "label": "Jordan"}, - {"key": "ARE", "label": "United Arab Emirates"}, - {"key": "QAT", "label": "Qatar"}, - {"key": "KWT", "label": "Kuwait"}, - {"key": "IRQ", "label": "Iraq"}, - {"key": "OMN", "label": "Oman"}, - {"key": "VUT", "label": "Vanuatu"}, - {"key": "KHM", "label": "Cambodia"}, - {"key": "THA", "label": "Thailand"}, - {"key": "LAO", "label": "Laos"}, - {"key": "MMR", "label": "Myanmar"}, - {"key": "VNM", "label": "Vietnam"}, - {"key": "PRK", "label": "North Korea"}, - {"key": "KOR", "label": "South Korea"}, - {"key": "MNG", "label": "Mongolia"}, - {"key": "IND", "label": "India"}, - {"key": "BGD", "label": "Bangladesh"}, - {"key": "BTN", "label": "Bhutan"}, - {"key": "NPL", "label": "Nepal"}, - {"key": "PAK", "label": "Pakistan"}, - {"key": "AFG", "label": "Afghanistan"}, - {"key": "TJK", "label": "Tajikistan"}, - {"key": "KGZ", "label": "Kyrgyzstan"}, - {"key": "TKM", "label": "Turkmenistan"}, - {"key": "IRN", "label": "Iran"}, - {"key": "SYR", "label": "Syria"}, - {"key": "ARM", "label": "Armenia"}, - {"key": "SWE", "label": "Sweden"}, - {"key": "BLR", "label": "Belarus"}, - {"key": "UKR", "label": "Ukraine"}, - {"key": "POL", "label": "Poland"}, - {"key": "AUT", "label": "Austria"}, - {"key": "HUN", "label": "Hungary"}, - {"key": "MDA", "label": "Moldova"}, - {"key": "ROU", "label": "Romania"}, - {"key": "LTU", "label": "Lithuania"}, - {"key": "LVA", "label": "Latvia"}, - {"key": "EST", "label": "Estonia"}, - {"key": "DEU", "label": "Germany"}, - {"key": "BGR", "label": "Bulgaria"}, - {"key": "GRC", "label": "Greece"}, - {"key": "TUR", "label": "Turkey"}, - {"key": "ALB", "label": "Albania"}, - {"key": "HRV", "label": "Croatia"}, - {"key": "CHE", "label": "Switzerland"}, - {"key": "LUX", "label": "Luxembourg"}, - {"key": "BEL", "label": "Belgium"}, - {"key": "NLD", "label": "Netherlands"}, - {"key": "PRT", "label": "Portugal"}, - {"key": "ESP", "label": "Spain"}, - {"key": "IRL", "label": "Ireland"}, - {"key": "NCL", "label": "New Caledonia"}, - {"key": "SLB", "label": "Solomon Islands"}, - {"key": "NZL", "label": "New Zealand"}, - {"key": "AUS", "label": "Australia"}, - {"key": "LKA", "label": "Sri Lanka"}, - {"key": "CHN", "label": "China"}, - {"key": "TWN", "label": "Taiwan"}, - {"key": "ITA", "label": "Italy"}, - {"key": "DNK", "label": "Denmark"}, - {"key": "GBR", "label": "Scotland"}, - {"key": "ISL", "label": "Iceland"}, - {"key": "AZE", "label": "Azerbaijan"}, - {"key": "GEO", "label": "Georgia"}, - {"key": "PHL", "label": "Philippines"}, - {"key": "MYS", "label": "Malaysia"}, - {"key": "BRN", "label": "Brunei"}, - {"key": "SVN", "label": "Slovenia"}, - {"key": "FIN", "label": "Finland"}, - {"key": "SVK", "label": "Slovakia"}, - {"key": "CZE", "label": "Czech Republic"}, - {"key": "ERI", "label": "Eritrea"}, - {"key": "JPN", "label": "Japan"}, - {"key": "PRY", "label": "Paraguay"}, - {"key": "YEM", "label": "Yemen"}, - {"key": "SAU", "label": "Saudi Arabia"}, - {"key": "ATA", "label": "Antarctica"}, - {"key": "CYN", "label": "Northern Cyprus"}, - {"key": "CYP", "label": "Cyprus"}, - {"key": "MAR", "label": "Morocco"}, - {"key": "EGY", "label": "Egypt"}, - {"key": "LBY", "label": "Libya"}, - {"key": "ETH", "label": "Ethiopia"}, - {"key": "DJI", "label": "Djibouti"}, - {"key": "SOL", "label": "Somaliland"}, - {"key": "UGA", "label": "Uganda"}, - {"key": "RWA", "label": "Rwanda"}, - {"key": "BIH", "label": "Bosnia and Herzegovina"}, - {"key": "MKD", "label": "Macedonia"}, - {"key": "SRB", "label": "Serbia"}, - {"key": "MNE", "label": "Montenegro"}, - {"key": "KOS", "label": "Kosovo"}, - {"key": "TTO", "label": "Trinidad and Tobago"}, - {"key": "SDS", "label": "South Sudan"}, + { + "key": iso3, + "label": name, + } + for iso3, name in COUNTRIES_LIST ] diff --git a/scripts/list_relief_web_countries.sh b/scripts/list_relief_web_countries.sh new file mode 100755 index 0000000000..f1d790d49e --- /dev/null +++ b/scripts/list_relief_web_countries.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +function get_countries_data { + curl 'https://api.reliefweb.int/v1/countries?fields[include][]=name&fields[include][]=iso3&limit=300' \ + --globoff +} + +COUNTRIES_DATA=`get_countries_data` + +echo $COUNTRIES_DATA | jq -r '.data[].fields | [.iso3, .name] | @csv'