Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # all country codes present, except GB.
- # GB has been changed to UK
- COUNTRIES = (
- ("AD", "Andorra"),
- ("AE", "United Arab Emirates"),
- ("AF", "Afghanistan"),
- ("AG", "Antigua and Barbuda"),
- ("AI", "Anguilla"),
- ("AL", "Albania"),
- ("AM", "Armenia"),
- ("AO", "Angola"),
- ("AQ", "Antarctica"),
- ("AR", "Argentina"),
- ("AS", "American Samoa"),
- ("AT", "Austria"),
- ("AU", "Australia"),
- ("AW", "Aruba"),
- ("AX", "Åland Islands"),
- ("AZ", "Azerbaijan"),
- ("BA", "Bosnia and Herzegovina"),
- ("BB", "Barbados"),
- ("BD", "Bangladesh"),
- ("BE", "Belgium"),
- ("BF", "Burkina Faso"),
- ("BG", "Bulgaria"),
- ("BH", "Bahrain"),
- ("BI", "Burundi"),
- ("BJ", "Benin"),
- ("BL", "Saint Barthelemy"),
- ("BM", "Bermuda"),
- ("BN", "Brunei Darussalam"),
- ("BO", "Bolivia"),
- ("BQ", "Bonaire, Sint Eustatius and Saba"),
- ("BR", "Brazil"),
- ("BS", "Bahamas"),
- ("BT", "Bhutan"),
- ("BV", "Bouvet Island"),
- ("BW", "Botswana"),
- ("BY", "Belarus"),
- ("BZ", "Belize"),
- ("CA", "Canada"),
- ("CB", "Caribbean Nations"),
- ("CC", "Cocos (Keeling) Islands"),
- ("CD", "Democratic Republic of the Congo"),
- ("CF", "Central African Republic"),
- ("CG", "Republic of the Congo"),
- ("CH", "Switzerland"),
- ("CI", "Côte d'Ivoire"),
- ("CK", "Cook Islands"),
- ("CL", "Chile"),
- ("CM", "Cameroon"),
- ("CN", "China"),
- ("CO", "Colombia"),
- ("CR", "Costa Rica"),
- ("CU", "Cuba"),
- ("CV", "Cabo Verde"),
- ("CW", "Curaçao"),
- ("CX", "Christmas Island"),
- ("CY", "Cyprus"),
- ("CZ", "Czech Republic"),
- ("DE", "Germany"),
- ("DJ", "Djibouti"),
- ("DK", "Denmark"),
- ("DM", "Dominica"),
- ("DO", "Dominican Republic"),
- ("DZ", "Algeria"),
- ("EC", "Ecuador"),
- ("EE", "Estonia"),
- ("EG", "Egypt"),
- ("EH", "Western Sahara"),
- ("ER", "Eritrea"),
- ("ES", "Spain"),
- ("ET", "Ethiopia"),
- ("FI", "Finland"),
- ("FJ", "Fiji"),
- ("FK", "Falkland Islands [Malvinas]"),
- ("FM", "Micronesia"),
- ("FO", "Faroe Islands"),
- ("FR", "France"),
- ("GA", "Gabon"),
- ("GD", "Grenada"),
- ("GE", "Georgia"),
- ("GF", "French Guiana"),
- ("GG", "Guernsey"),
- ("GH", "Ghana"),
- ("GI", "Gibraltar"),
- ("GL", "Greenland"),
- ("GM", "Gambia"),
- ("GN", "Guinea"),
- ("GP", "Guadeloupe"),
- ("GQ", "Equatorial Guinea"),
- ("GR", "Greece"),
- ("GS", "South Georgia and the South Sandwich Islands"),
- ("GT", "Guatemala"),
- ("GU", "Guam"),
- ("GW", "Guinea-Bissau"),
- ("GY", "Guyana"),
- ("HK", "Hong Kong"),
- ("HM", "Heard Island and McDonald Islands"),
- ("HN", "Honduras"),
- ("HR", "Croatia"),
- ("HT", "Haiti"),
- ("HU", "Hungary"),
- ("ID", "Indonesia"),
- ("IE", "Ireland"),
- ("IL", "Israel"),
- ("IM", "Isle of Man"),
- ("IN", "India"),
- ("IO", "British Indian Ocean Territory"),
- ("IQ", "Iraq"),
- ("IR", "Iran"),
- ("IS", "Iceland"),
- ("IT", "Italy"),
- ("JE", "Jersey"),
- ("JM", "Jamaica"),
- ("JO", "Jordan"),
- ("JP", "Japan"),
- ("KE", "Kenya"),
- ("KG", "Kyrgyzstan"),
- ("KH", "Cambodia"),
- ("KI", "Kiribati"),
- ("KM", "Comoros"),
- ("KN", "Saint Kitts and Nevis"),
- ("KP", "North Korea"),
- ("KR", "South Korea"),
- ("KW", "Kuwait"),
- ("KY", "Cayman Islands"),
- ("KZ", "Kazakhstan"),
- ("LA", "Lao People's Democratic Republic"),
- ("LB", "Lebanon"),
- ("LC", "Saint Lucia"),
- ("LI", "Liechtenstein"),
- ("LK", "Sri Lanka"),
- ("LR", "Liberia"),
- ("LS", "Lesotho"),
- ("LT", "Lithuania"),
- ("LU", "Luxembourg"),
- ("LV", "Latvia"),
- ("LY", "Libya"),
- ("MA", "Morocco"),
- ("MC", "Monaco"),
- ("MD", "Moldova"),
- ("ME", "Montenegro"),
- ("MF", "Saint Martin"),
- ("MG", "Madagascar"),
- ("MH", "Marshall Islands"),
- ("MK", "Macedonia"),
- ("ML", "Mali"),
- ("MM", "Myanmar"),
- ("MN", "Mongolia"),
- ("MO", "Macao"),
- ("MP", "Northern Mariana Islands"),
- ("MQ", "Martinique"),
- ("MR", "Mauritania"),
- ("MS", "Montserrat"),
- ("MT", "Malta"),
- ("MU", "Mauritius"),
- ("MV", "Maldives"),
- ("MW", "Malawi"),
- ("MX", "Mexico"),
- ("MY", "Malaysia"),
- ("MZ", "Mozambique"),
- ("NA", "Namibia"),
- ("NC", "New Caledonia"),
- ("NE", "Niger"),
- ("NF", "Norfolk Island"),
- ("NG", "Nigeria"),
- ("NI", "Nicaragua"),
- ("NL", "Netherlands"),
- ("NO", "Norway"),
- ("NP", "Nepal"),
- ("NR", "Nauru"),
- ("NU", "Niue"),
- ("NZ", "New Zealand"),
- ("OM", "Oman"),
- ("PA", "Panama"),
- ("PE", "Peru"),
- ("PF", "French Polynesia"),
- ("PG", "Papua New Guinea"),
- ("PH", "Philippines"),
- ("PK", "Pakistan"),
- ("PL", "Poland"),
- ("PM", "Saint Pierre and Miquelon"),
- ("PN", "Pitcairn"),
- ("PR", "Puerto Rico"),
- ("PS", "Palestine"),
- ("PT", "Portugal"),
- ("PW", "Palau"),
- ("PY", "Paraguay"),
- ("QA", "Qatar"),
- ("RE", "Réunion"),
- ("RO", "Romania"),
- ("RS", "Serbia"),
- ("RU", "Russian Federation"),
- ("RW", "Rwanda"),
- ("SA", "Saudi Arabia"),
- ("SB", "Solomon Islands"),
- ("SC", "Seychelles"),
- ("SD", "Sudan"),
- ("SE", "Sweden"),
- ("SG", "Singapore"),
- ("SH", "Saint Helena, Ascension and Tristan da Cunha"),
- ("SI", "Slovenia"),
- ("SJ", "Svalbard and Jan Mayen"),
- ("SK", "Slovakia"),
- ("SL", "Sierra Leone"),
- ("SM", "San Marino"),
- ("SN", "Senegal"),
- ("SO", "Somalia"),
- ("SR", "Suriname"),
- ("SS", "South Sudan"),
- ("ST", "Sao Tome and Principe"),
- ("SV", "El Salvador"),
- ("SX", "Sint Maarten (Dutch part)"),
- ("SY", "Syrian Arab Republic"),
- ("SZ", "Swaziland"),
- ("TC", "Turks and Caicos Islands"),
- ("TD", "Chad"),
- ("TF", "French Southern Territories"),
- ("TG", "Togo"),
- ("TH", "Thailand"),
- ("TJ", "Tajikistan"),
- ("TK", "Tokelau"),
- ("TL", "Timor-Leste"),
- ("TM", "Turkmenistan"),
- ("TN", "Tunisia"),
- ("TO", "Tonga"),
- ("TR", "Turkey"),
- ("TT", "Trinidad and Tobago"),
- ("TV", "Tuvalu"),
- ("TW", "Taiwan"),
- ("TZ", "Tanzania"),
- ("UA", "Ukraine"),
- ("UG", "Uganda"),
- ("UK", "United Kingdom"),
- ("UM", "United States Minor Outlying Islands"),
- ("US", "United States of America"),
- ("UY", "Uruguay"),
- ("UZ", "Uzbekistan"),
- ("VA", "Holy See"),
- ("VC", "Saint Vincent and the Grenadines"),
- ("VE", "Venezuela"),
- ("VG", "Virgin Islands (British)"),
- ("VI", "Virgin Islands (U.S.)"),
- ("VN", "Vietnam"),
- ("VU", "Vanuatu"),
- ("WF", "Wallis and Futuna"),
- ("WS", "Samoa"),
- ("YE", "Yemen"),
- ("YT", "Mayotte"),
- ("ZA", "South Africa"),
- ("ZM", "Zambia"),
- ("ZW", "Zimbabwe"),
- )
- COUNTRY_TO_REGION = {
- "AD": 3,
- "AE": 4,
- "AF": 2,
- "AG": 0,
- "AI": 0,
- "AL": 3,
- "AM": 4,
- "AO": 4,
- "AQ": 6,
- "AR": 0,
- "AS": 5,
- "AT": 3,
- "AU": 2,
- "AW": 0,
- "AX": 3,
- "AZ": 4,
- "BA": 3,
- "BB": 0,
- "BD": 2,
- "BE": 3,
- "BF": 4,
- "BG": 3,
- "BH": 4,
- "BI": 4,
- "BJ": 4,
- "BL": 0,
- "BM": 1,
- "BN": 2,
- "BO": 0,
- "BQ": 0,
- "BR": 0,
- "BS": 0,
- "BT": 2,
- "BV": 6,
- "BW": 4,
- "BY": 3,
- "BZ": 0,
- "CA": 1,
- "CB": 0,
- "CC": 6,
- "CD": 4,
- "CF": 4,
- "CG": 4,
- "CH": 3,
- "CI": 4,
- "CK": 5,
- "CL": 0,
- "CM": 4,
- "CN": 2,
- "CO": 0,
- "CR": 0,
- "CU": 0,
- "CV": 4,
- "CW": 0,
- "CX": 6,
- "CY": 4,
- "CZ": 3,
- "DE": 3,
- "DJ": 4,
- "DK": 3,
- "DM": 0,
- "DO": 0,
- "DZ": 4,
- "EC": 0,
- "EE": 3,
- "EG": 4,
- "EH": 4,
- "ER": 4,
- "ES": 3,
- "ET": 4,
- "FI": 3,
- "FJ": 5,
- "FK": 0,
- "FM": 5,
- "FO": 3,
- "FR": 3,
- "GA": 4,
- "GD": 0,
- "GE": 4,
- "GF": 0,
- "GG": 3,
- "GH": 4,
- "GI": 3,
- "GL": 1,
- "GM": 4,
- "GN": 4,
- "GP": 0,
- "GQ": 4,
- "GR": 3,
- "GS": 6,
- "GT": 0,
- "GU": 5,
- "GW": 4,
- "GY": 0,
- "HK": 2,
- "HM": 6,
- "HN": 0,
- "HR": 3,
- "HT": 0,
- "HU": 3,
- "ID": 2,
- "IE": 3,
- "IL": 4,
- "IM": 3,
- "IN": 2,
- "IO": 6,
- "IQ": 4,
- "IR": 4,
- "IS": 3,
- "IT": 3,
- "JE": 3,
- "JM": 0,
- "JO": 4,
- "JP": 2,
- "KE": 4,
- "KG": 2,
- "KH": 2,
- "KI": 5,
- "KM": 4,
- "KN": 0,
- "KP": 2,
- "KR": 2,
- "KW": 4,
- "KY": 0,
- "KZ": 2,
- "LA": 2,
- "LB": 4,
- "LC": 0,
- "LI": 3,
- "LK": 2,
- "LR": 4,
- "LS": 4,
- "LT": 3,
- "LU": 3,
- "LV": 3,
- "LY": 4,
- "MA": 4,
- "MC": 3,
- "MD": 3,
- "ME": 3,
- "MF": 0,
- "MG": 4,
- "MH": 5,
- "MK": 3,
- "ML": 4,
- "MM": 2,
- "MN": 2,
- "MO": 2,
- "MP": 5,
- "MQ": 0,
- "MR": 4,
- "MS": 0,
- "MT": 3,
- "MU": 4,
- "MV": 2,
- "MW": 4,
- "MX": 0,
- "MY": 2,
- "MZ": 4,
- "NA": 4,
- "NC": 5,
- "NE": 4,
- "NF": 2,
- "NG": 4,
- "NI": 0,
- "NL": 3,
- "NO": 3,
- "NP": 2,
- "NR": 5,
- "NU": 5,
- "NZ": 2,
- "OM": 4,
- "PA": 0,
- "PE": 0,
- "PF": 5,
- "PG": 5,
- "PH": 2,
- "PK": 2,
- "PL": 3,
- "PM": 1,
- "PN": 5,
- "PR": 0,
- "PS": 4,
- "PT": 3,
- "PW": 5,
- "PY": 0,
- "QA": 4,
- "RE": 4,
- "RO": 3,
- "RS": 3,
- "RU": 3,
- "RW": 4,
- "SA": 4,
- "SB": 5,
- "SC": 4,
- "SD": 4,
- "SE": 3,
- "SG": 2,
- "SH": 4,
- "SI": 3,
- "SJ": 3,
- "SK": 3,
- "SL": 4,
- "SM": 3,
- "SN": 4,
- "SO": 4,
- "SR": 0,
- "SS": 4,
- "ST": 4,
- "SV": 0,
- "SX": 0,
- "SY": 4,
- "SZ": 4,
- "TC": 0,
- "TD": 4,
- "TF": 6,
- "TG": 4,
- "TH": 2,
- "TJ": 2,
- "TK": 5,
- "TL": 2,
- "TM": 4,
- "TN": 4,
- "TO": 5,
- "TR": 4,
- "TT": 0,
- "TV": 5,
- "TW": 2,
- "TZ": 4,
- "UA": 3,
- "UG": 4,
- "UK": 3,
- "UM": 6,
- "US": 1,
- "UY": 0,
- "UZ": 2,
- "VA": 3,
- "VC": 0,
- "VE": 0,
- "VG": 0,
- "VI": 0,
- "VN": 2,
- "VU": 5,
- "WF": 5,
- "WS": 5,
- "YE": 4,
- "YT": 4,
- "ZA": 4,
- "ZM": 4,
- "ZW": 4
- }
- REGIONS = (
- (0, "Americas - Central & Latin"),
- (1, "Americas - Northern"),
- (2, "Asia Pacific"),
- (3, "Europe"),
- (4, "Middle East & Africa"),
- (5, "Oceania"),
- (6, "Others"),
- )
Add Comment
Please, Sign In to add comment