1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 country_to_iso = {
20 'Afghanistan': 'AF',
21 'Albania': 'AL',
22 'Algeria': 'DZ',
23 'American Samoa': 'AS',
24 'Andorra': 'AD',
25 'Angola': 'AO',
26 'Anguilla': 'AI',
27 'Antarctica': 'AQ',
28 'Antigua and Barbuda': 'AG',
29 'Argentina': 'AR',
30 'Armenia': 'AM',
31 'Aruba': 'AW',
32 'Australia': 'AU',
33 'Austria': 'AT',
34 'Azerbaijan': 'AZ',
35 'Bahamas': 'BS',
36 'Bahrain': 'BH',
37 'Bangladesh': 'BD',
38 'Barbados': 'BB',
39 'Belarus': 'BY',
40 'Belgium': 'BE',
41 'Belize': 'BZ',
42 'Benin': 'BJ',
43 'Bermuda': 'BM',
44 'Bhutan': 'BT',
45 'Bolivia': 'BO',
46 'Bosnia and Herzegovina': 'BA',
47 'Botswana': 'BW',
48 'Bouvet Island': 'BV',
49 'Brazil': 'BR',
50 'British Indian Ocean Territory': 'IO',
51 'Brunei Darussalam': 'BN',
52 'Bulgaria': 'BG',
53 'Burkina Faso': 'BF',
54 'Burundi': 'BI',
55 'Cambodia': 'KH',
56 'Cameroon': 'CM',
57 'Canada': 'CA',
58 'Cape Verde': 'CV',
59 'Cayman Islands': 'KY',
60 'Central African Republic': 'CF',
61 'Chad': 'TD',
62 'Chile': 'CL',
63 'China': 'CN',
64 'Christmas Island': 'CX',
65 'Colombia': 'CO',
66 'Comoros': 'KM',
67 'Congo': 'CG',
68 'Cook Islands': 'CK',
69 'Costa Rica': 'CR',
70 'Cote d\'Ivoire': 'CI',
71 'Croatia': 'HR',
72 'Cyprus': 'CY',
73 'Czech Republic': 'CZ',
74 'Denmark': 'DK',
75 'Djibouti': 'DJ',
76 'Dominica': 'DM',
77 'Dominican Republic': 'DO',
78 'East Timor': 'TP',
79 'Ecuador': 'EC',
80 'Egypt': 'EG',
81 'El Salvador': 'SV',
82 'Equatorial Guinea': 'GQ',
83 'Eritrea': 'ER',
84 'Estonia': 'EE',
85 'Ethiopia': 'ET',
86 'Falkland Islands (Malvinas)': 'FK',
87 'Faroe Island': 'FO',
88 'Fiji': 'FJ',
89 'Finland': 'FI',
90 'France (European Territory)': 'FX',
91 'France': 'FR',
92 'France, Metropolitan': 'FR',
93 'French Guiana': 'GF',
94 'French Polynesia': 'PF',
95 'Gabon': 'GA',
96 'Gambia': 'GM',
97 'Georgia': 'GE',
98 'Germany': 'DE',
99 'Ghana': 'GH',
100 'Gibraltar': 'GI',
101 'Greece': 'GR',
102 'Greenland': 'GL',
103 'Grenada': 'GD',
104 'Guadeloupe': 'GP',
105 'Guam': 'GU',
106 'Guatemala': 'GT',
107 'Guinea-Bissau': 'GW',
108 'Guinea': 'GN',
109 'Guyana': 'GY',
110 'Haiti': 'HT',
111 'Heard and McDonald Island': 'HM',
112 'Honduras': 'HN',
113 'Hong Kong': 'HK',
114 'Hungary': 'HU',
115 'Iceland': 'IS',
116 'India': 'IN',
117 'Indian': 'IN',
118 'Indonesia': 'ID',
119 'Ireland': 'IE',
120 'Israel': 'IL',
121 'Italy': 'IT',
122 'Jamaica': 'JM',
123 'Japan': 'JP',
124 'Jordan': 'JO',
125 'Kazakhstan': 'KZ',
126 'Kenya': 'KE',
127 'Korea, Republic of': 'KR',
128 'Kuwait': 'KW',
129 'Kyrgyzstan': 'KG',
130 'Laos': 'LA',
131 'Latvia': 'LV',
132 'Lebanon': 'LB',
133 'Lesoth': 'LS',
134 'Liberia': 'LR',
135 'Libyan Arab Jamahiriya': 'LY',
136 'Liechtenstein': 'LI',
137 'Lithuania': 'LT',
138 'Lithuania': 'LX',
139 'Luxembourg': 'LU',
140 'Macau': 'MO',
141 'Macedonia': 'MK',
142 'Madagascar': 'MG',
143 'Malawi': 'MW',
144 'Malaysia': 'MY',
145 'Maldives': 'MV',
146 'Mali': 'ML',
147 'Malta': 'MT',
148 'Marshall Islands': 'MH',
149 'Martinique': 'MQ',
150 'Mauritania': 'MR',
151 'Mauritius': 'MU',
152 'Mexico': 'MX',
153 'Micronesia (Federated States of)': 'FM',
154 'Moldova': 'MD',
155 'Moldova, Republic of': 'MD',
156 'Monaco': 'MC',
157 'Mongolia': 'MN',
158 'Montenegro': 'ME',
159 'Montserrat': 'MS',
160 'Morocco': 'MA',
161 'Mozambique': 'MZ',
162 'Namibia': 'NA',
163 'Nederland': 'NL',
164 'Nepal': 'NP',
165 'Netherlands Antilles': 'AN',
166 'Netherlands': 'NL',
167 'New Caledonia': 'NC',
168 'New Zealand': 'NZ',
169 'Nicaragua': 'NI',
170 'Nigeria': 'NG',
171 'Niger': 'NE',
172 'Norway': 'NO',
173 'Oman': 'OM',
174 'Pakistan': 'PK',
175 'Palau': 'PW',
176 'Panama': 'PA',
177 'Papua New Guinea': 'PG',
178 'Paraguay': 'PY',
179 'Peru': 'PE',
180 'Philippines': 'PH',
181 'Pitcairn': 'PN',
182 'Poland': 'PL',
183 'Portugal': 'PT',
184 'Puerto Rico': 'PR',
185 'Qatar': 'QA',
186 'Reunion Island': 'RE',
187 'Romania': 'RO',
188 'Russian Federation': 'RU',
189 'Rwanda': 'RW',
190 'Saint Kitts and Nevis': 'KN',
191 'Saint Lucia': 'LC',
192 'Saint Pierre and Miquelon': 'PM',
193 'Saint Vincent and the Grenadines': 'VC',
194 'Samoa': 'WS',
195 'San Marino': 'SM',
196 'Saudi Arabia': 'SA',
197 'Serbia': 'RS',
198 'Serbia and Montenegro': 'CS',
199 'Senegal': 'SN',
200 'Seychelles': 'SC',
201 'Sierra Leone': 'SL',
202 'Singapore': 'SG',
203 'Slovakia': 'SK',
204 'Slovenia': 'SI',
205 'Solomon Islands': 'SB',
206 'Somalia': 'SO',
207 'South Africa': 'ZA',
208 'Spain': 'ES',
209 'Sri Lanka': 'LK',
210 'Sudan': 'SD',
211 'Suriname': 'SR',
212 'Svalbard & Jan Mayen Island': 'SJ',
213 'Swaziland': 'SZ',
214 'Sweden': 'SE',
215 'Switzerland': 'CH',
216 'Syrian Arab Republic': 'SY',
217 'Taiwan, Republic of': 'TW',
218 'Tanzania, United Republic of': 'TZ',
219 'Thailand': 'TH',
220 'Togo': 'TG',
221 'Tonga': 'TO',
222 'Trinidad and Tobago': 'TT',
223 'Tunisia': 'TN',
224 'Turkey': 'TR',
225 'Turkmenistan': 'TM',
226 'Turks and Caicos Islands': 'TC',
227 'Tuvalu': 'TV',
228 'Uganda': 'UG',
229 'Ukraine': 'UA',
230 'United Arab Emirates': 'AE',
231 'United Kingdom': 'GB',
232 'United States': 'US',
233 'Uruguay': 'UY',
234 'US Minor Outlying Islands': 'UM',
235 'Uzbekistan': 'UZ',
236 'Vanuatu': 'VU',
237 'Vatican City State (Holy See)': 'VA',
238 'Venezuela': 'VE',
239 'Vietnam': 'VN',
240 'Virgin Islands (British)': 'VG',
241 'Virgin Islands (U.S.)': 'VI',
242 'Wallis and Futuna': 'WF',
243 'Yemen': 'YE',
244 'Yugoslavia': 'YU',
245 'Zaire': 'ZR',
246 'Zambia': 'ZM',
247 'Zimbabwe': 'ZW',
248 }
249
250
251 t9_countries = {
252 "Korea, Democratic People's Republic of": 'KP',
253 'North Korea': 'KP',
254 'Afghanistan': 'AF',
255 'Cuba': 'CU',
256 'Iran': 'IR',
257 'Iraq': 'IQ',
258 'Islamic Republic of Iran': 'IR',
259 'Sudan': 'SD',
260 'Syrian Arab Republic': 'AY'
261 }
262
263
264
265 if __name__ == "__main__":
266 print("You can not run this module by itself")
267 import sys
268 sys.exit(-1)
269
270