1"""Auto-generated file, do not edit by hand."""
2# Copyright (C) 2010-2025 The Libphonenumber Authors
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
16from ..phonemetadata import PhoneMetadata
17
18_AVAILABLE_REGION_CODES = ['AC','AD','AE','AF','AG','AI','AL','AM','AO','AR','AS','AT','AU','AW','AX','AZ','BA','BB','BD','BE','BF','BG','BH','BI','BJ','BL','BM','BN','BO','BQ','BR','BS','BT','BW','BY','BZ','CA','CC','CD','CF','CG','CH','CI','CK','CL','CM','CN','CO','CR','CU','CV','CW','CX','CY','CZ','DE','DJ','DK','DM','DO','DZ','EC','EE','EG','EH','ER','ES','ET','FI','FJ','FK','FM','FO','FR','GA','GB','GD','GE','GF','GG','GH','GI','GL','GM','GN','GP','GQ','GR','GT','GU','GW','GY','HK','HN','HR','HT','HU','ID','IE','IL','IM','IN','IO','IQ','IR','IS','IT','JE','JM','JO','JP','KE','KG','KH','KI','KM','KN','KP','KR','KW','KY','KZ','LA','LB','LC','LI','LK','LR','LS','LT','LU','LV','LY','MA','MC','MD','ME','MF','MG','MH','MK','ML','MM','MN','MO','MP','MQ','MR','MS','MT','MU','MV','MW','MX','MY','MZ','NA','NC','NE','NF','NG','NI','NL','NO','NP','NR','NU','NZ','OM','PA','PE','PF','PG','PH','PK','PL','PM','PR','PS','PT','PW','PY','QA','RE','RO','RS','RU','RW','SA','SB','SC','SD','SE','SG','SH','SI','SJ','SK','SL','SM','SN','SO','SR','SS','ST','SV','SX','SY','SZ','TA','TC','TD','TG','TH','TJ','TK','TL','TM','TN','TO','TR','TT','TV','TW','TZ','UA','UG','US','UY','UZ','VA','VC','VE','VG','VI','VN','VU','WF','WS','XK','YE','YT','ZA','ZM','ZW']
19_AVAILABLE_NONGEO_COUNTRY_CODES = [800, 808, 870, 878, 881, 882, 883, 888, 979]
20
21def _load_region(code):
22 __import__("region_%s" % code, globals(), locals(),
23 fromlist=["PHONE_METADATA_%s" % code], level=1)
24
25for _region_code in _AVAILABLE_REGION_CODES:
26 PhoneMetadata.register_region_loader(_region_code, _load_region)
27
28
29for _country_code in _AVAILABLE_NONGEO_COUNTRY_CODES:
30 PhoneMetadata.register_nongeo_region_loader(_country_code, _load_region)
31
32from .alt_format_255 import PHONE_ALT_FORMAT_255
33from .alt_format_27 import PHONE_ALT_FORMAT_27
34from .alt_format_30 import PHONE_ALT_FORMAT_30
35from .alt_format_31 import PHONE_ALT_FORMAT_31
36from .alt_format_34 import PHONE_ALT_FORMAT_34
37from .alt_format_350 import PHONE_ALT_FORMAT_350
38from .alt_format_351 import PHONE_ALT_FORMAT_351
39from .alt_format_352 import PHONE_ALT_FORMAT_352
40from .alt_format_358 import PHONE_ALT_FORMAT_358
41from .alt_format_359 import PHONE_ALT_FORMAT_359
42from .alt_format_36 import PHONE_ALT_FORMAT_36
43from .alt_format_372 import PHONE_ALT_FORMAT_372
44from .alt_format_373 import PHONE_ALT_FORMAT_373
45from .alt_format_380 import PHONE_ALT_FORMAT_380
46from .alt_format_381 import PHONE_ALT_FORMAT_381
47from .alt_format_385 import PHONE_ALT_FORMAT_385
48from .alt_format_39 import PHONE_ALT_FORMAT_39
49from .alt_format_43 import PHONE_ALT_FORMAT_43
50from .alt_format_44 import PHONE_ALT_FORMAT_44
51from .alt_format_49 import PHONE_ALT_FORMAT_49
52from .alt_format_505 import PHONE_ALT_FORMAT_505
53from .alt_format_506 import PHONE_ALT_FORMAT_506
54from .alt_format_52 import PHONE_ALT_FORMAT_52
55from .alt_format_54 import PHONE_ALT_FORMAT_54
56from .alt_format_55 import PHONE_ALT_FORMAT_55
57from .alt_format_58 import PHONE_ALT_FORMAT_58
58from .alt_format_595 import PHONE_ALT_FORMAT_595
59from .alt_format_61 import PHONE_ALT_FORMAT_61
60from .alt_format_62 import PHONE_ALT_FORMAT_62
61from .alt_format_64 import PHONE_ALT_FORMAT_64
62from .alt_format_66 import PHONE_ALT_FORMAT_66
63from .alt_format_675 import PHONE_ALT_FORMAT_675
64from .alt_format_676 import PHONE_ALT_FORMAT_676
65from .alt_format_679 import PHONE_ALT_FORMAT_679
66from .alt_format_7 import PHONE_ALT_FORMAT_7
67from .alt_format_81 import PHONE_ALT_FORMAT_81
68from .alt_format_84 import PHONE_ALT_FORMAT_84
69from .alt_format_855 import PHONE_ALT_FORMAT_855
70from .alt_format_856 import PHONE_ALT_FORMAT_856
71from .alt_format_90 import PHONE_ALT_FORMAT_90
72from .alt_format_91 import PHONE_ALT_FORMAT_91
73from .alt_format_94 import PHONE_ALT_FORMAT_94
74from .alt_format_95 import PHONE_ALT_FORMAT_95
75from .alt_format_971 import PHONE_ALT_FORMAT_971
76from .alt_format_972 import PHONE_ALT_FORMAT_972
77from .alt_format_995 import PHONE_ALT_FORMAT_995
78_ALT_NUMBER_FORMATS = {255: PHONE_ALT_FORMAT_255, 27: PHONE_ALT_FORMAT_27, 30: PHONE_ALT_FORMAT_30, 31: PHONE_ALT_FORMAT_31, 34: PHONE_ALT_FORMAT_34, 350: PHONE_ALT_FORMAT_350, 351: PHONE_ALT_FORMAT_351, 352: PHONE_ALT_FORMAT_352, 358: PHONE_ALT_FORMAT_358, 359: PHONE_ALT_FORMAT_359, 36: PHONE_ALT_FORMAT_36, 372: PHONE_ALT_FORMAT_372, 373: PHONE_ALT_FORMAT_373, 380: PHONE_ALT_FORMAT_380, 381: PHONE_ALT_FORMAT_381, 385: PHONE_ALT_FORMAT_385, 39: PHONE_ALT_FORMAT_39, 43: PHONE_ALT_FORMAT_43, 44: PHONE_ALT_FORMAT_44, 49: PHONE_ALT_FORMAT_49, 505: PHONE_ALT_FORMAT_505, 506: PHONE_ALT_FORMAT_506, 52: PHONE_ALT_FORMAT_52, 54: PHONE_ALT_FORMAT_54, 55: PHONE_ALT_FORMAT_55, 58: PHONE_ALT_FORMAT_58, 595: PHONE_ALT_FORMAT_595, 61: PHONE_ALT_FORMAT_61, 62: PHONE_ALT_FORMAT_62, 64: PHONE_ALT_FORMAT_64, 66: PHONE_ALT_FORMAT_66, 675: PHONE_ALT_FORMAT_675, 676: PHONE_ALT_FORMAT_676, 679: PHONE_ALT_FORMAT_679, 7: PHONE_ALT_FORMAT_7, 81: PHONE_ALT_FORMAT_81, 84: PHONE_ALT_FORMAT_84, 855: PHONE_ALT_FORMAT_855, 856: PHONE_ALT_FORMAT_856, 90: PHONE_ALT_FORMAT_90, 91: PHONE_ALT_FORMAT_91, 94: PHONE_ALT_FORMAT_94, 95: PHONE_ALT_FORMAT_95, 971: PHONE_ALT_FORMAT_971, 972: PHONE_ALT_FORMAT_972, 995: PHONE_ALT_FORMAT_995}
79
80# A mapping from a country code to the region codes which
81# denote the country/region represented by that country code.
82# In the case of multiple countries sharing a calling code,
83# such as the NANPA countries, the one indicated with
84# "main_country_for_code" in the metadata should be first.
85_COUNTRY_CODE_TO_REGION_CODE = {
86 1: ("US", "AG", "AI", "AS", "BB", "BM", "BS", "CA", "DM", "DO", "GD", "GU", "JM", "KN", "KY", "LC", "MP", "MS", "PR", "SX", "TC", "TT", "VC", "VG", "VI",),
87 7: ("RU", "KZ",),
88 20: ("EG",),
89 27: ("ZA",),
90 30: ("GR",),
91 31: ("NL",),
92 32: ("BE",),
93 33: ("FR",),
94 34: ("ES",),
95 36: ("HU",),
96 39: ("IT", "VA",),
97 40: ("RO",),
98 41: ("CH",),
99 43: ("AT",),
100 44: ("GB", "GG", "IM", "JE",),
101 45: ("DK",),
102 46: ("SE",),
103 47: ("NO", "SJ",),
104 48: ("PL",),
105 49: ("DE",),
106 51: ("PE",),
107 52: ("MX",),
108 53: ("CU",),
109 54: ("AR",),
110 55: ("BR",),
111 56: ("CL",),
112 57: ("CO",),
113 58: ("VE",),
114 60: ("MY",),
115 61: ("AU", "CC", "CX",),
116 62: ("ID",),
117 63: ("PH",),
118 64: ("NZ",),
119 65: ("SG",),
120 66: ("TH",),
121 81: ("JP",),
122 82: ("KR",),
123 84: ("VN",),
124 86: ("CN",),
125 90: ("TR",),
126 91: ("IN",),
127 92: ("PK",),
128 93: ("AF",),
129 94: ("LK",),
130 95: ("MM",),
131 98: ("IR",),
132 211: ("SS",),
133 212: ("MA", "EH",),
134 213: ("DZ",),
135 216: ("TN",),
136 218: ("LY",),
137 220: ("GM",),
138 221: ("SN",),
139 222: ("MR",),
140 223: ("ML",),
141 224: ("GN",),
142 225: ("CI",),
143 226: ("BF",),
144 227: ("NE",),
145 228: ("TG",),
146 229: ("BJ",),
147 230: ("MU",),
148 231: ("LR",),
149 232: ("SL",),
150 233: ("GH",),
151 234: ("NG",),
152 235: ("TD",),
153 236: ("CF",),
154 237: ("CM",),
155 238: ("CV",),
156 239: ("ST",),
157 240: ("GQ",),
158 241: ("GA",),
159 242: ("CG",),
160 243: ("CD",),
161 244: ("AO",),
162 245: ("GW",),
163 246: ("IO",),
164 247: ("AC",),
165 248: ("SC",),
166 249: ("SD",),
167 250: ("RW",),
168 251: ("ET",),
169 252: ("SO",),
170 253: ("DJ",),
171 254: ("KE",),
172 255: ("TZ",),
173 256: ("UG",),
174 257: ("BI",),
175 258: ("MZ",),
176 260: ("ZM",),
177 261: ("MG",),
178 262: ("RE", "YT",),
179 263: ("ZW",),
180 264: ("NA",),
181 265: ("MW",),
182 266: ("LS",),
183 267: ("BW",),
184 268: ("SZ",),
185 269: ("KM",),
186 290: ("SH", "TA",),
187 291: ("ER",),
188 297: ("AW",),
189 298: ("FO",),
190 299: ("GL",),
191 350: ("GI",),
192 351: ("PT",),
193 352: ("LU",),
194 353: ("IE",),
195 354: ("IS",),
196 355: ("AL",),
197 356: ("MT",),
198 357: ("CY",),
199 358: ("FI", "AX",),
200 359: ("BG",),
201 370: ("LT",),
202 371: ("LV",),
203 372: ("EE",),
204 373: ("MD",),
205 374: ("AM",),
206 375: ("BY",),
207 376: ("AD",),
208 377: ("MC",),
209 378: ("SM",),
210 380: ("UA",),
211 381: ("RS",),
212 382: ("ME",),
213 383: ("XK",),
214 385: ("HR",),
215 386: ("SI",),
216 387: ("BA",),
217 389: ("MK",),
218 420: ("CZ",),
219 421: ("SK",),
220 423: ("LI",),
221 500: ("FK",),
222 501: ("BZ",),
223 502: ("GT",),
224 503: ("SV",),
225 504: ("HN",),
226 505: ("NI",),
227 506: ("CR",),
228 507: ("PA",),
229 508: ("PM",),
230 509: ("HT",),
231 590: ("GP", "BL", "MF",),
232 591: ("BO",),
233 592: ("GY",),
234 593: ("EC",),
235 594: ("GF",),
236 595: ("PY",),
237 596: ("MQ",),
238 597: ("SR",),
239 598: ("UY",),
240 599: ("CW", "BQ",),
241 670: ("TL",),
242 672: ("NF",),
243 673: ("BN",),
244 674: ("NR",),
245 675: ("PG",),
246 676: ("TO",),
247 677: ("SB",),
248 678: ("VU",),
249 679: ("FJ",),
250 680: ("PW",),
251 681: ("WF",),
252 682: ("CK",),
253 683: ("NU",),
254 685: ("WS",),
255 686: ("KI",),
256 687: ("NC",),
257 688: ("TV",),
258 689: ("PF",),
259 690: ("TK",),
260 691: ("FM",),
261 692: ("MH",),
262 800: ("001",),
263 808: ("001",),
264 850: ("KP",),
265 852: ("HK",),
266 853: ("MO",),
267 855: ("KH",),
268 856: ("LA",),
269 870: ("001",),
270 878: ("001",),
271 880: ("BD",),
272 881: ("001",),
273 882: ("001",),
274 883: ("001",),
275 886: ("TW",),
276 888: ("001",),
277 960: ("MV",),
278 961: ("LB",),
279 962: ("JO",),
280 963: ("SY",),
281 964: ("IQ",),
282 965: ("KW",),
283 966: ("SA",),
284 967: ("YE",),
285 968: ("OM",),
286 970: ("PS",),
287 971: ("AE",),
288 972: ("IL",),
289 973: ("BH",),
290 974: ("QA",),
291 975: ("BT",),
292 976: ("MN",),
293 977: ("NP",),
294 979: ("001",),
295 992: ("TJ",),
296 993: ("TM",),
297 994: ("AZ",),
298 995: ("GE",),
299 996: ("KG",),
300 998: ("UZ",),
301}