From 4fb9b03db9d0a8b7febfc6422430cbdf15f1151f Mon Sep 17 00:00:00 2001 From: rolux Date: Wed, 15 Aug 2012 18:00:52 +0200 Subject: [PATCH] update geo module --- ox/geo.py | 1564 ++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 1302 insertions(+), 262 deletions(-) diff --git a/ox/geo.py b/ox/geo.py index bb095f1..0ed0f17 100644 --- a/ox/geo.py +++ b/ox/geo.py @@ -2,279 +2,1319 @@ # vi:si:et:sw=4:sts=4:ts=4 # GPL 2008 -__all__ = ['get_country_name'] +__all__ = ['get_country', 'get_country_name'] ''' var countries = {}; Ox.COUNTRIES.forEach(function(country) { if (country.code.length == 2) { - countries[country.code] = country.name; + countries[country.code] = { + name: country.name, + region: country.region, + continent: country.continent + }; } }); -Ox.print(JSON.stringify(countries)); +Ox.print(JSON.stringify(countries, null, ' ')); ''' COUNTRIES = { - "AC": u"Ascension", - "AD": u"Andorra", - "AE": u"United Arab Emirates", - "AF": u"Afghanistan", - "AG": u"Antigua and Barbuda", - "AI": u"Anguilla", - "AL": u"Albania", - "AM": u"Armenia", - "AO": u"Angola", - "AQ": u"Antarctica", - "AR": u"Argentina", - "AS": u"American Samoa", - "AT": u"Austria", - "AU": u"Australia", - "AW": u"Aruba", - "AX": u"Åland Islands", - "AZ": u"Azerbaijan", - "BA": u"Bosnia and Herzegovina", - "BB": u"Barbados", - "BD": u"Bangladesh", - "BE": u"Belgium", - "BF": u"Burkina Faso", - "BG": u"Bulgaria", - "BH": u"Bahrain", - "BI": u"Burundi", - "BJ": u"Benin", - "BL": u"Saint Barthélemy", - "BM": u"Bermuda", - "BN": u"Brunei", - "BO": u"Bolivia", - "BQ": u"Bonaire, Sint Eustatius and Saba", - "BR": u"Brazil", - "BS": u"Bahamas", - "BT": u"Bhutan", - "BV": u"Bouvet Island", - "BW": u"Botswana", - "BY": u"Belarus", - "BZ": u"Belize", - "CA": u"Canada", - "CC": u"Cocos Islands", - "CD": u"Democratic Republic of the Congo", - "CF": u"Central African Republic", - "CG": u"Republic of the Congo", - "CH": u"Switzerland", - "CI": u"Côte d'Ivoire", - "CK": u"Cook Islands", - "CL": u"Chile", - "CM": u"Cameroon", - "CN": u"China", - "CO": u"Colombia", - "CP": u"Clipperton Island", - "CR": u"Costa Rica", - "CU": u"Cuba", - "CV": u"Cape Verde", - "CW": u"Curaçao", - "CX": u"Christmas Island", - "CY": u"Cyprus", - "CZ": u"Czech Republic", - "DE": u"Germany", - "DG": u"Diego Garcia", - "DJ": u"Djibouti", - "DK": u"Denmark", - "DM": u"Dominica", - "DO": u"Dominican Republic", - "DZ": u"Algeria", - "EA": u"Ceuta and Melilla", - "EC": u"Ecuador", - "EE": u"Estonia", - "EG": u"Egypt", - "EH": u"Sahrawi", - "ER": u"Eritrea", - "ES": u"Spain", - "ET": u"Ethiopia", - "EU": u"European Union", - "FI": u"Finland", - "FJ": u"Fiji", - "FK": u"Falkland Islands", - "FM": u"Micronesia", - "FO": u"Faroe Islands", - "FR": u"France", - "GA": u"Gabon", - "GB": u"United Kingdom", - "GD": u"Grenada", - "GE": u"Georgia", - "GF": u"French Guiana", - "GG": u"Guernsey", - "GH": u"Ghana", - "GI": u"Gibraltar", - "GL": u"Greenland", - "GM": u"Gambia", - "GN": u"Guinea", - "GP": u"Guadeloupe", - "GQ": u"Equatorial Guinea", - "GR": u"Greece", - "GS": u"South Georgia and the South Sandwich Islands", - "GT": u"Guatemala", - "GU": u"Guam", - "GW": u"Guinea-Bissau", - "GY": u"Guyana", - "HK": u"Hong Kong", - "HM": u"Heard Island and McDonald Islands", - "HN": u"Honduras", - "HR": u"Croatia", - "HT": u"Haiti", - "HU": u"Hungary", - "IC": u"Canary Islands", - "ID": u"Indonesia", - "IE": u"Ireland", - "IL": u"Israel", - "IM": u"Isle of Man", - "IN": u"India", - "IO": u"British Indian Ocean Territory", - "IQ": u"Iraq", - "IR": u"Iran", - "IS": u"Iceland", - "IT": u"Italy", - "JE": u"Jersey", - "JM": u"Jamaica", - "JO": u"Jordan", - "JP": u"Japan", - "KE": u"Kenya", - "KG": u"Kyrgyzstan", - "KH": u"Cambodia", - "KI": u"Kiribati", - "KM": u"Comoros", - "KN": u"Saint Kitts and Nevis", - "KP": u"North Korea", - "KR": u"South Korea", - "KW": u"Kuwait", - "KY": u"Cayman Islands", - "KZ": u"Kazakhstan", - "LA": u"Laos", - "LB": u"Lebanon", - "LC": u"Saint Lucia", - "LI": u"Liechtenstein", - "LK": u"Sri Lanka", - "LR": u"Liberia", - "LS": u"Lesotho", - "LT": u"Lithuania", - "LU": u"Luxembourg", - "LV": u"Latvia", - "LY": u"Libya", - "MA": u"Morocco", - "MC": u"Monaco", - "MD": u"Moldova", - "ME": u"Montenegro", - "MF": u"Saint Martin", - "MG": u"Madagascar", - "MH": u"Marshall Islands", - "MK": u"Macedonia", - "ML": u"Mali", - "MM": u"Myanmar", - "MN": u"Mongolia", - "MO": u"Macau", - "MP": u"Northern Mariana Islands", - "MQ": u"Martinique", - "MR": u"Mauritania", - "MS": u"Montserrat", - "MT": u"Malta", - "MU": u"Mauritius", - "MV": u"Maldives", - "MW": u"Malawi", - "MX": u"Mexico", - "MY": u"Malaysia", - "MZ": u"Mozambique", - "NA": u"Namibia", - "NC": u"New Caledonia", - "NE": u"Niger", - "NF": u"Norfolk Island", - "NG": u"Nigeria", - "NI": u"Nicaragua", - "NL": u"Netherlands", - "NO": u"Norway", - "NP": u"Nepal", - "NR": u"Nauru", - "NU": u"Niue", - "NZ": u"New Zealand", - "OM": u"Oman", - "PA": u"Panama", - "PE": u"Peru", - "PF": u"French Polynesia", - "PG": u"Papua New Guinea", - "PH": u"Philippines", - "PK": u"Pakistan", - "PL": u"Poland", - "PM": u"Saint Pierre and Miquelon", - "PN": u"Pitcairn Islands", - "PR": u"Puerto Rico", - "PS": u"Palestine", - "PT": u"Portugal", - "PW": u"Palau", - "PY": u"Paraguay", - "QA": u"Qatar", - "RE": u"Réunion", - "RO": u"Romania", - "RS": u"Serbia", - "RU": u"Russia", - "RW": u"Rwanda", - "SA": u"Saudi Arabia", - "SB": u"Solomon Islands", - "SC": u"Seychelles", - "SD": u"Sudan", - "SE": u"Sweden", - "SG": u"Singapore", - "SH": u"Saint Helena, Ascension and Tristan da Cunha", - "SI": u"Slovenia", - "SJ": u"Svalbard and Jan Mayen", - "SK": u"Slovakia", - "SL": u"Sierra Leone", - "SM": u"San Marino", - "SN": u"Senegal", - "SO": u"Somalia", - "SR": u"Suriname", - "SS": u"South Sudan", - "ST": u"São Tomé and Príncipe", - "SV": u"El Salvador", - "SX": u"Sint Maarten", - "SY": u"Syria", - "SZ": u"Swaziland", - "TA": u"Tristan da Cunha", - "TC": u"Turks and Caicos Islands", - "TD": u"Chad", - "TF": u"French Southern Territories", - "TG": u"Togo", - "TH": u"Thailand", - "TJ": u"Tajikistan", - "TK": u"Tokelau", - "TL": u"Timor-Leste", - "TM": u"Turkmenistan", - "TN": u"Tunisia", - "TO": u"Tonga", - "TR": u"Turkey", - "TT": u"Trinidad and Tobago", - "TV": u"Tuvalu", - "TW": u"Taiwan", - "TZ": u"Tanzania", - "UA": u"Ukraine", - "UG": u"Uganda", - "UK": u"United Kingdom", - "UM": u"United States Minor Outlying Islands", - "US": u"United States", - "UY": u"Uruguay", - "UZ": u"Uzbekistan", - "VA": u"Vatican City", - "VC": u"Saint Vincent and the Grenadines", - "VE": u"Venezuela", - "VG": u"British Virgin Islands", - "VI": u"United States Virgin Islands", - "VN": u"Vietnam", - "VU": u"Vanuatu", - "WF": u"Wallis and Futuna", - "WS": u"Samoa", - "XK": u"Kosovo", - "YE": u"Yemen", - "YT": u"Mayotte", - "ZA": u"South Africa", - "ZM": u"Zambia", - "ZW": u"Zimbabwe" + "AC": { + "name": "Ascension", + "region": "Western Africa", + "continent": "Africa" + }, + "AD": { + "name": "Andorra", + "region": "Southern Europe", + "continent": "Europe" + }, + "AE": { + "name": "United Arab Emirates", + "region": "Western Asia", + "continent": "Asia" + }, + "AF": { + "name": "Afghanistan", + "region": "Southern Asia", + "continent": "Asia" + }, + "AG": { + "name": "Antigua and Barbuda", + "region": "Caribbean", + "continent": "South America" + }, + "AI": { + "name": "Anguilla", + "region": "Caribbean", + "continent": "South America" + }, + "AL": { + "name": "Albania", + "region": "Southern Europe", + "continent": "Europe" + }, + "AM": { + "name": "Armenia", + "region": "Western Asia", + "continent": "Asia" + }, + "AO": { + "name": "Angola", + "region": "Middle Africa", + "continent": "Africa" + }, + "AQ": { + "name": "Antarctica", + "region": "Antarctica", + "continent": "Antarctica" + }, + "AR": { + "name": "Argentina", + "region": "Southern America", + "continent": "South America" + }, + "AS": { + "name": "American Samoa", + "region": "Polynesia", + "continent": "Oceania" + }, + "AT": { + "name": "Austria", + "region": "Western Europe", + "continent": "Europe" + }, + "AU": { + "name": "Australia", + "region": "Australia and New Zealand", + "continent": "Oceania" + }, + "AW": { + "name": "Aruba", + "region": "Caribbean", + "continent": "South America" + }, + "AX": { + "name": "Åland Islands", + "region": "Northern Europe", + "continent": "Europe" + }, + "AZ": { + "name": "Azerbaijan", + "region": "Western Asia", + "continent": "Asia" + }, + "BA": { + "name": "Bosnia and Herzegovina", + "region": "Southern Europe", + "continent": "Europe" + }, + "BB": { + "name": "Barbados", + "region": "Caribbean", + "continent": "South America" + }, + "BD": { + "name": "Bangladesh", + "region": "Southern Asia", + "continent": "Asia" + }, + "BE": { + "name": "Belgium", + "region": "Western Europe", + "continent": "Europe" + }, + "BF": { + "name": "Burkina Faso", + "region": "Western Africa", + "continent": "Africa" + }, + "BG": { + "name": "Bulgaria", + "region": "Eastern Europe", + "continent": "Europe" + }, + "BH": { + "name": "Bahrain", + "region": "Western Asia", + "continent": "Asia" + }, + "BI": { + "name": "Burundi", + "region": "Eastern Africa", + "continent": "Africa" + }, + "BJ": { + "name": "Benin", + "region": "Western Africa", + "continent": "Africa" + }, + "BL": { + "name": "Saint Barthélemy", + "region": "Caribbean", + "continent": "South America" + }, + "BM": { + "name": "Bermuda", + "region": "Northern America", + "continent": "North America" + }, + "BN": { + "name": "Brunei", + "region": "South-Eastern Asia", + "continent": "Asia" + }, + "BO": { + "name": "Bolivia", + "region": "Southern America", + "continent": "South America" + }, + "BQ": { + "name": "Bonaire, Sint Eustatius and Saba", + "region": "Caribbean", + "continent": "South America" + }, + "BR": { + "name": "Brazil", + "region": "Southern America", + "continent": "South America" + }, + "BS": { + "name": "Bahamas", + "region": "Caribbean", + "continent": "South America" + }, + "BT": { + "name": "Bhutan", + "region": "Southern Asia", + "continent": "Asia" + }, + "BV": { + "name": "Bouvet Island", + "region": "Antarctica", + "continent": "Antarctica" + }, + "BW": { + "name": "Botswana", + "region": "Southern Africa", + "continent": "Africa" + }, + "BY": { + "name": "Belarus", + "region": "Eastern Europe", + "continent": "Europe" + }, + "BZ": { + "name": "Belize", + "region": "Central America", + "continent": "South America" + }, + "CA": { + "name": "Canada", + "region": "Northern America", + "continent": "North America" + }, + "CC": { + "name": "Cocos Islands", + "region": "South-Eastern Asia", + "continent": "Asia" + }, + "CD": { + "name": "Democratic Republic of the Congo", + "region": "Middle Africa", + "continent": "Africa" + }, + "CF": { + "name": "Central African Republic", + "region": "Middle Africa", + "continent": "Africa" + }, + "CG": { + "name": "Republic of the Congo", + "region": "Middle Africa", + "continent": "Africa" + }, + "CH": { + "name": "Switzerland", + "region": "Western Europe", + "continent": "Europe" + }, + "CI": { + "name": "Côte d'Ivoire", + "region": "Western Africa", + "continent": "Africa" + }, + "CK": { + "name": "Cook Islands", + "region": "Polynesia", + "continent": "Oceania" + }, + "CL": { + "name": "Chile", + "region": "Southern America", + "continent": "South America" + }, + "CM": { + "name": "Cameroon", + "region": "Middle Africa", + "continent": "Africa" + }, + "CN": { + "name": "China", + "region": "Eastern Asia", + "continent": "Asia" + }, + "CO": { + "name": "Colombia", + "region": "Southern America", + "continent": "South America" + }, + "CP": { + "name": "Clipperton Island", + "region": "Central America", + "continent": "South America" + }, + "CR": { + "name": "Costa Rica", + "region": "Central America", + "continent": "South America" + }, + "CU": { + "name": "Cuba", + "region": "Caribbean", + "continent": "South America" + }, + "CV": { + "name": "Cape Verde", + "region": "Western Africa", + "continent": "Africa" + }, + "CW": { + "name": "Curaçao", + "region": "Caribbean", + "continent": "South America" + }, + "CX": { + "name": "Christmas Island", + "region": "South-Eastern Asia", + "continent": "Asia" + }, + "CY": { + "name": "Cyprus", + "region": "Western Asia", + "continent": "Asia" + }, + "CZ": { + "name": "Czech Republic", + "region": "Eastern Europe", + "continent": "Europe" + }, + "DE": { + "name": "Germany", + "region": "Western Europe", + "continent": "Europe" + }, + "DG": { + "name": "Diego Garcia", + "region": "Southern Asia", + "continent": "Asia" + }, + "DJ": { + "name": "Djibouti", + "region": "Eastern Africa", + "continent": "Africa" + }, + "DK": { + "name": "Denmark", + "region": "Northern Europe", + "continent": "Europe" + }, + "DM": { + "name": "Dominica", + "region": "Caribbean", + "continent": "South America" + }, + "DO": { + "name": "Dominican Republic", + "region": "Caribbean", + "continent": "South America" + }, + "DZ": { + "name": "Algeria", + "region": "Northern Africa", + "continent": "Africa" + }, + "EA": { + "name": "Ceuta and Melilla", + "region": "Northern Africa", + "continent": "Africa" + }, + "EC": { + "name": "Ecuador", + "region": "Southern America", + "continent": "South America" + }, + "EE": { + "name": "Estonia", + "region": "Northern Europe", + "continent": "Europe" + }, + "EG": { + "name": "Egypt", + "region": "Northern Africa", + "continent": "Africa" + }, + "EH": { + "name": "Sahrawi", + "region": "Northern Africa", + "continent": "Africa" + }, + "ER": { + "name": "Eritrea", + "region": "Eastern Africa", + "continent": "Africa" + }, + "ES": { + "name": "Spain", + "region": "Southern Europe", + "continent": "Europe" + }, + "ET": { + "name": "Ethiopia", + "region": "Eastern Africa", + "continent": "Africa" + }, + "EU": { + "name": "European Union", + "region": "Western Europe", + "continent": "Europe" + }, + "FI": { + "name": "Finland", + "region": "Northern Europe", + "continent": "Europe" + }, + "FJ": { + "name": "Fiji", + "region": "Melanesia", + "continent": "Oceania" + }, + "FK": { + "name": "Falkland Islands", + "region": "Southern America", + "continent": "South America" + }, + "FM": { + "name": "Micronesia", + "region": "Micronesia", + "continent": "Oceania" + }, + "FO": { + "name": "Faroe Islands", + "region": "Northern Europe", + "continent": "Europe" + }, + "FR": { + "name": "France", + "region": "Western Europe", + "continent": "Europe" + }, + "GA": { + "name": "Gabon", + "region": "Middle Africa", + "continent": "Africa" + }, + "GB": { + "name": "United Kingdom", + "region": "Northern Europe", + "continent": "Europe" + }, + "GD": { + "name": "Grenada", + "region": "Caribbean", + "continent": "South America" + }, + "GE": { + "name": "Georgia", + "region": "Western Asia", + "continent": "Asia" + }, + "GF": { + "name": "French Guiana", + "region": "Southern America", + "continent": "South America" + }, + "GG": { + "name": "Guernsey", + "region": "Northern Europe", + "continent": "Europe" + }, + "GH": { + "name": "Ghana", + "region": "Western Africa", + "continent": "Africa" + }, + "GI": { + "name": "Gibraltar", + "region": "Southern Europe", + "continent": "Europe" + }, + "GL": { + "name": "Greenland", + "region": "Northern America", + "continent": "North America" + }, + "GM": { + "name": "Gambia", + "region": "Western Africa", + "continent": "Africa" + }, + "GN": { + "name": "Guinea", + "region": "Western Africa", + "continent": "Africa" + }, + "GP": { + "name": "Guadeloupe", + "region": "Caribbean", + "continent": "South America" + }, + "GQ": { + "name": "Equatorial Guinea", + "region": "Middle Africa", + "continent": "Africa" + }, + "GR": { + "name": "Greece", + "region": "Southern Europe", + "continent": "Europe" + }, + "GS": { + "name": "South Georgia and the South Sandwich Islands", + "region": "Antarctica", + "continent": "Antarctica" + }, + "GT": { + "name": "Guatemala", + "region": "Central America", + "continent": "South America" + }, + "GU": { + "name": "Guam", + "region": "Micronesia", + "continent": "Oceania" + }, + "GW": { + "name": "Guinea-Bissau", + "region": "Western Africa", + "continent": "Africa" + }, + "GY": { + "name": "Guyana", + "region": "Southern America", + "continent": "South America" + }, + "HK": { + "name": "Hong Kong", + "region": "Eastern Asia", + "continent": "Asia" + }, + "HM": { + "name": "Heard Island and McDonald Islands", + "region": "Antarctica", + "continent": "Antarctica" + }, + "HN": { + "name": "Honduras", + "region": "Central America", + "continent": "South America" + }, + "HR": { + "name": "Croatia", + "region": "Southern Europe", + "continent": "Europe" + }, + "HT": { + "name": "Haiti", + "region": "Caribbean", + "continent": "South America" + }, + "HU": { + "name": "Hungary", + "region": "Eastern Europe", + "continent": "Europe" + }, + "IC": { + "name": "Canary Islands", + "region": "Northern Africa", + "continent": "Africa" + }, + "ID": { + "name": "Indonesia", + "region": "South-Eastern Asia", + "continent": "Asia" + }, + "IE": { + "name": "Ireland", + "region": "Northern Europe", + "continent": "Europe" + }, + "IL": { + "name": "Israel", + "region": "Western Asia", + "continent": "Asia" + }, + "IM": { + "name": "Isle of Man", + "region": "Northern Europe", + "continent": "Europe" + }, + "IN": { + "name": "India", + "region": "Southern Asia", + "continent": "Asia" + }, + "IO": { + "name": "British Indian Ocean Territory", + "region": "Southern Asia", + "continent": "Asia" + }, + "IQ": { + "name": "Iraq", + "region": "Western Asia", + "continent": "Asia" + }, + "IR": { + "name": "Iran", + "region": "Southern Asia", + "continent": "Asia" + }, + "IS": { + "name": "Iceland", + "region": "Northern Europe", + "continent": "Europe" + }, + "IT": { + "name": "Italy", + "region": "Southern Europe", + "continent": "Europe" + }, + "JE": { + "name": "Jersey", + "region": "Northern Europe", + "continent": "Europe" + }, + "JM": { + "name": "Jamaica", + "region": "Caribbean", + "continent": "South America" + }, + "JO": { + "name": "Jordan", + "region": "Western Asia", + "continent": "Asia" + }, + "JP": { + "name": "Japan", + "region": "Eastern Asia", + "continent": "Asia" + }, + "KE": { + "name": "Kenya", + "region": "Eastern Africa", + "continent": "Africa" + }, + "KG": { + "name": "Kyrgyzstan", + "region": "Central Asia", + "continent": "Asia" + }, + "KH": { + "name": "Cambodia", + "region": "South-Eastern Asia", + "continent": "Asia" + }, + "KI": { + "name": "Kiribati", + "region": "Micronesia", + "continent": "Oceania" + }, + "KM": { + "name": "Comoros", + "region": "Eastern Africa", + "continent": "Africa" + }, + "KN": { + "name": "Saint Kitts and Nevis", + "region": "Caribbean", + "continent": "South America" + }, + "KP": { + "name": "North Korea", + "region": "Eastern Asia", + "continent": "Asia" + }, + "KR": { + "name": "South Korea", + "region": "Eastern Asia", + "continent": "Asia" + }, + "KW": { + "name": "Kuwait", + "region": "Western Asia", + "continent": "Asia" + }, + "KY": { + "name": "Cayman Islands", + "region": "Caribbean", + "continent": "South America" + }, + "KZ": { + "name": "Kazakhstan", + "region": "Central Asia", + "continent": "Asia" + }, + "LA": { + "name": "Laos", + "region": "South-Eastern Asia", + "continent": "Asia" + }, + "LB": { + "name": "Lebanon", + "region": "Western Asia", + "continent": "Asia" + }, + "LC": { + "name": "Saint Lucia", + "region": "Caribbean", + "continent": "South America" + }, + "LI": { + "name": "Liechtenstein", + "region": "Western Europe", + "continent": "Europe" + }, + "LK": { + "name": "Sri Lanka", + "region": "Southern Asia", + "continent": "Asia" + }, + "LR": { + "name": "Liberia", + "region": "Western Africa", + "continent": "Africa" + }, + "LS": { + "name": "Lesotho", + "region": "Southern Africa", + "continent": "Africa" + }, + "LT": { + "name": "Lithuania", + "region": "Northern Europe", + "continent": "Europe" + }, + "LU": { + "name": "Luxembourg", + "region": "Western Europe", + "continent": "Europe" + }, + "LV": { + "name": "Latvia", + "region": "Northern Europe", + "continent": "Europe" + }, + "LY": { + "name": "Libya", + "region": "Northern Africa", + "continent": "Africa" + }, + "MA": { + "name": "Morocco", + "region": "Northern Africa", + "continent": "Africa" + }, + "MC": { + "name": "Monaco", + "region": "Western Europe", + "continent": "Europe" + }, + "MD": { + "name": "Moldova", + "region": "Eastern Europe", + "continent": "Europe" + }, + "ME": { + "name": "Montenegro", + "region": "Southern Europe", + "continent": "Europe" + }, + "MF": { + "name": "Saint Martin", + "region": "Caribbean", + "continent": "South America" + }, + "MG": { + "name": "Madagascar", + "region": "Eastern Africa", + "continent": "Africa" + }, + "MH": { + "name": "Marshall Islands", + "region": "Micronesia", + "continent": "Oceania" + }, + "MK": { + "name": "Macedonia", + "region": "Southern Europe", + "continent": "Europe" + }, + "ML": { + "name": "Mali", + "region": "Western Africa", + "continent": "Africa" + }, + "MM": { + "name": "Myanmar", + "region": "South-Eastern Asia", + "continent": "Asia" + }, + "MN": { + "name": "Mongolia", + "region": "Eastern Asia", + "continent": "Asia" + }, + "MO": { + "name": "Macau", + "region": "Eastern Asia", + "continent": "Asia" + }, + "MP": { + "name": "Northern Mariana Islands", + "region": "Micronesia", + "continent": "Oceania" + }, + "MQ": { + "name": "Martinique", + "region": "Caribbean", + "continent": "South America" + }, + "MR": { + "name": "Mauritania", + "region": "Western Africa", + "continent": "Africa" + }, + "MS": { + "name": "Montserrat", + "region": "Caribbean", + "continent": "South America" + }, + "MT": { + "name": "Malta", + "region": "Southern Europe", + "continent": "Europe" + }, + "MU": { + "name": "Mauritius", + "region": "Eastern Africa", + "continent": "Africa" + }, + "MV": { + "name": "Maldives", + "region": "Southern Asia", + "continent": "Asia" + }, + "MW": { + "name": "Malawi", + "region": "Eastern Africa", + "continent": "Africa" + }, + "MX": { + "name": "Mexico", + "region": "Central America", + "continent": "South America" + }, + "MY": { + "name": "Malaysia", + "region": "South-Eastern Asia", + "continent": "Asia" + }, + "MZ": { + "name": "Mozambique", + "region": "Eastern Africa", + "continent": "Africa" + }, + "NA": { + "name": "Namibia", + "region": "Southern Africa", + "continent": "Africa" + }, + "NC": { + "name": "New Caledonia", + "region": "Melanesia", + "continent": "Oceania" + }, + "NE": { + "name": "Niger", + "region": "Western Africa", + "continent": "Africa" + }, + "NF": { + "name": "Norfolk Island", + "region": "Australia and New Zealand", + "continent": "Oceania" + }, + "NG": { + "name": "Nigeria", + "region": "Western Africa", + "continent": "Africa" + }, + "NI": { + "name": "Nicaragua", + "region": "Central America", + "continent": "South America" + }, + "NL": { + "name": "Netherlands", + "region": "Western Europe", + "continent": "Europe" + }, + "NO": { + "name": "Norway", + "region": "Northern Europe", + "continent": "Europe" + }, + "NP": { + "name": "Nepal", + "region": "Southern Asia", + "continent": "Asia" + }, + "NR": { + "name": "Nauru", + "region": "Micronesia", + "continent": "Oceania" + }, + "NU": { + "name": "Niue", + "region": "Polynesia", + "continent": "Oceania" + }, + "NZ": { + "name": "New Zealand", + "region": "Australia and New Zealand", + "continent": "Oceania" + }, + "OM": { + "name": "Oman", + "region": "Western Asia", + "continent": "Asia" + }, + "PA": { + "name": "Panama", + "region": "Central America", + "continent": "South America" + }, + "PE": { + "name": "Peru", + "region": "Southern America", + "continent": "South America" + }, + "PF": { + "name": "French Polynesia", + "region": "Polynesia", + "continent": "Oceania" + }, + "PG": { + "name": "Papua New Guinea", + "region": "Melanesia", + "continent": "Oceania" + }, + "PH": { + "name": "Philippines", + "region": "South-Eastern Asia", + "continent": "Asia" + }, + "PK": { + "name": "Pakistan", + "region": "Southern Asia", + "continent": "Asia" + }, + "PL": { + "name": "Poland", + "region": "Eastern Europe", + "continent": "Europe" + }, + "PM": { + "name": "Saint Pierre and Miquelon", + "region": "Northern America", + "continent": "North America" + }, + "PN": { + "name": "Pitcairn Islands", + "region": "Polynesia", + "continent": "Oceania" + }, + "PR": { + "name": "Puerto Rico", + "region": "Caribbean", + "continent": "South America" + }, + "PS": { + "name": "Palestine", + "region": "Western Asia", + "continent": "Asia" + }, + "PT": { + "name": "Portugal", + "region": "Southern Europe", + "continent": "Europe" + }, + "PW": { + "name": "Palau", + "region": "Micronesia", + "continent": "Oceania" + }, + "PY": { + "name": "Paraguay", + "region": "Southern America", + "continent": "South America" + }, + "QA": { + "name": "Qatar", + "region": "Western Asia", + "continent": "Asia" + }, + "RE": { + "name": "Réunion", + "region": "Eastern Africa", + "continent": "Africa" + }, + "RO": { + "name": "Romania", + "region": "Eastern Europe", + "continent": "Europe" + }, + "RS": { + "name": "Serbia", + "region": "Southern Europe", + "continent": "Europe" + }, + "RU": { + "name": "Russia", + "region": "Eastern Europe", + "continent": "Europe" + }, + "RW": { + "name": "Rwanda", + "region": "Eastern Africa", + "continent": "Africa" + }, + "SA": { + "name": "Saudi Arabia", + "region": "Western Asia", + "continent": "Asia" + }, + "SB": { + "name": "Solomon Islands", + "region": "Melanesia", + "continent": "Oceania" + }, + "SC": { + "name": "Seychelles", + "region": "Eastern Africa", + "continent": "Africa" + }, + "SD": { + "name": "Sudan", + "region": "Northern Africa", + "continent": "Africa" + }, + "SE": { + "name": "Sweden", + "region": "Northern Europe", + "continent": "Europe" + }, + "SG": { + "name": "Singapore", + "region": "South-Eastern Asia", + "continent": "Asia" + }, + "SH": { + "name": "Saint Helena, Ascension and Tristan da Cunha", + "region": "Western Africa", + "continent": "Africa" + }, + "SI": { + "name": "Slovenia", + "region": "Southern Europe", + "continent": "Europe" + }, + "SJ": { + "name": "Svalbard and Jan Mayen", + "region": "Northern Europe", + "continent": "Europe" + }, + "SK": { + "name": "Slovakia", + "region": "Eastern Europe", + "continent": "Europe" + }, + "SL": { + "name": "Sierra Leone", + "region": "Western Africa", + "continent": "Africa" + }, + "SM": { + "name": "San Marino", + "region": "Southern Europe", + "continent": "Europe" + }, + "SN": { + "name": "Senegal", + "region": "Western Africa", + "continent": "Africa" + }, + "SO": { + "name": "Somalia", + "region": "Eastern Africa", + "continent": "Africa" + }, + "SR": { + "name": "Suriname", + "region": "Southern America", + "continent": "South America" + }, + "SS": { + "name": "South Sudan", + "region": "Northern Africa", + "continent": "Africa" + }, + "ST": { + "name": "São Tomé and Príncipe", + "region": "Middle Africa", + "continent": "Africa" + }, + "SV": { + "name": "El Salvador", + "region": "Central America", + "continent": "South America" + }, + "SX": { + "name": "Sint Maarten", + "region": "Caribbean", + "continent": "South America" + }, + "SY": { + "name": "Syria", + "region": "Western Asia", + "continent": "Asia" + }, + "SZ": { + "name": "Swaziland", + "region": "Southern Africa", + "continent": "Africa" + }, + "TA": { + "name": "Tristan da Cunha", + "region": "Western Africa", + "continent": "Africa" + }, + "TC": { + "name": "Turks and Caicos Islands", + "region": "Caribbean", + "continent": "South America" + }, + "TD": { + "name": "Chad", + "region": "Middle Africa", + "continent": "Africa" + }, + "TF": { + "name": "French Southern Territories", + "region": "Antarctica", + "continent": "Antarctica" + }, + "TG": { + "name": "Togo", + "region": "Western Africa", + "continent": "Africa" + }, + "TH": { + "name": "Thailand", + "region": "South-Eastern Asia", + "continent": "Asia" + }, + "TJ": { + "name": "Tajikistan", + "region": "Central Asia", + "continent": "Asia" + }, + "TK": { + "name": "Tokelau", + "region": "Polynesia", + "continent": "Oceania" + }, + "TL": { + "name": "Timor-Leste", + "region": "South-Eastern Asia", + "continent": "Asia" + }, + "TM": { + "name": "Turkmenistan", + "region": "Central Asia", + "continent": "Asia" + }, + "TN": { + "name": "Tunisia", + "region": "Northern Africa", + "continent": "Africa" + }, + "TO": { + "name": "Tonga", + "region": "Polynesia", + "continent": "Oceania" + }, + "TR": { + "name": "Turkey", + "region": "Western Asia", + "continent": "Asia" + }, + "TT": { + "name": "Trinidad and Tobago", + "region": "Caribbean", + "continent": "South America" + }, + "TV": { + "name": "Tuvalu", + "region": "Polynesia", + "continent": "Oceania" + }, + "TW": { + "name": "Taiwan", + "region": "Eastern Asia", + "continent": "Asia" + }, + "TZ": { + "name": "Tanzania", + "region": "Eastern Africa", + "continent": "Africa" + }, + "UA": { + "name": "Ukraine", + "region": "Eastern Europe", + "continent": "Europe" + }, + "UG": { + "name": "Uganda", + "region": "Eastern Africa", + "continent": "Africa" + }, + "UK": { + "name": "United Kingdom", + "region": "Northern Europe", + "continent": "Europe" + }, + "UM": { + "name": "United States Minor Outlying Islands", + "region": "Polynesia", + "continent": "Oceania" + }, + "US": { + "name": "United States", + "region": "Northern America", + "continent": "North America" + }, + "UY": { + "name": "Uruguay", + "region": "Southern America", + "continent": "South America" + }, + "UZ": { + "name": "Uzbekistan", + "region": "Central Asia", + "continent": "Asia" + }, + "VA": { + "name": "Vatican City", + "region": "Southern Europe", + "continent": "Europe" + }, + "VC": { + "name": "Saint Vincent and the Grenadines", + "region": "Caribbean", + "continent": "South America" + }, + "VE": { + "name": "Venezuela", + "region": "Southern America", + "continent": "South America" + }, + "VG": { + "name": "British Virgin Islands", + "region": "Caribbean", + "continent": "South America" + }, + "VI": { + "name": "United States Virgin Islands", + "region": "Caribbean", + "continent": "South America" + }, + "VN": { + "name": "Vietnam", + "region": "South-Eastern Asia", + "continent": "Asia" + }, + "VU": { + "name": "Vanuatu", + "region": "Melanesia", + "continent": "Oceania" + }, + "WF": { + "name": "Wallis and Futuna", + "region": "Polynesia", + "continent": "Oceania" + }, + "WS": { + "name": "Samoa", + "region": "Polynesia", + "continent": "Oceania" + }, + "XK": { + "name": "Kosovo", + "region": "Southern Europe", + "continent": "Europe" + }, + "YE": { + "name": "Yemen", + "region": "Western Asia", + "continent": "Asia" + }, + "YT": { + "name": "Mayotte", + "region": "Eastern Africa", + "continent": "Africa" + }, + "ZA": { + "name": "South Africa", + "region": "Southern Africa", + "continent": "Africa" + }, + "ZM": { + "name": "Zambia", + "region": "Eastern Africa", + "continent": "Africa" + }, + "ZW": { + "name": "Zimbabwe", + "region": "Eastern Africa", + "continent": "Africa" + } } +def get_country(country_code): + country_code = country_code.upper() + return COUNTRIES[country_code] if country_code in COUNTRIES else {} + def get_country_name(country_code): country_code = country_code.upper() - return COUNTRIES[country_code] if country_code in COUNTRIES else u'' + return COUNTRIES[country_code]['name'] if country_code in COUNTRIES else ''