Skip to content

Commit a8a457b

Browse files
committed
Generated Python files for metadata
1 parent 597eb6e commit a8a457b

38 files changed

Lines changed: 120 additions & 65 deletions

python/phonenumbers/data/__init__.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,23 @@ def _load_region(code):
3131

3232
from .alt_format_34 import PHONE_ALT_FORMAT_34
3333
from .alt_format_351 import PHONE_ALT_FORMAT_351
34+
from .alt_format_352 import PHONE_ALT_FORMAT_352
35+
from .alt_format_359 import PHONE_ALT_FORMAT_359
36+
from .alt_format_372 import PHONE_ALT_FORMAT_372
37+
from .alt_format_373 import PHONE_ALT_FORMAT_373
38+
from .alt_format_375 import PHONE_ALT_FORMAT_375
3439
from .alt_format_380 import PHONE_ALT_FORMAT_380
3540
from .alt_format_43 import PHONE_ALT_FORMAT_43
3641
from .alt_format_44 import PHONE_ALT_FORMAT_44
3742
from .alt_format_49 import PHONE_ALT_FORMAT_49
3843
from .alt_format_55 import PHONE_ALT_FORMAT_55
44+
from .alt_format_595 import PHONE_ALT_FORMAT_595
3945
from .alt_format_61 import PHONE_ALT_FORMAT_61
46+
from .alt_format_7 import PHONE_ALT_FORMAT_7
4047
from .alt_format_81 import PHONE_ALT_FORMAT_81
48+
from .alt_format_855 import PHONE_ALT_FORMAT_855
4149
from .alt_format_90 import PHONE_ALT_FORMAT_90
42-
_ALT_NUMBER_FORMATS = {34: PHONE_ALT_FORMAT_34, 351: PHONE_ALT_FORMAT_351, 380: PHONE_ALT_FORMAT_380, 43: PHONE_ALT_FORMAT_43, 44: PHONE_ALT_FORMAT_44, 49: PHONE_ALT_FORMAT_49, 55: PHONE_ALT_FORMAT_55, 61: PHONE_ALT_FORMAT_61, 81: PHONE_ALT_FORMAT_81, 90: PHONE_ALT_FORMAT_90}
50+
_ALT_NUMBER_FORMATS = {34: PHONE_ALT_FORMAT_34, 351: PHONE_ALT_FORMAT_351, 352: PHONE_ALT_FORMAT_352, 359: PHONE_ALT_FORMAT_359, 372: PHONE_ALT_FORMAT_372, 373: PHONE_ALT_FORMAT_373, 375: PHONE_ALT_FORMAT_375, 380: PHONE_ALT_FORMAT_380, 43: PHONE_ALT_FORMAT_43, 44: PHONE_ALT_FORMAT_44, 49: PHONE_ALT_FORMAT_49, 55: PHONE_ALT_FORMAT_55, 595: PHONE_ALT_FORMAT_595, 61: PHONE_ALT_FORMAT_61, 7: PHONE_ALT_FORMAT_7, 81: PHONE_ALT_FORMAT_81, 855: PHONE_ALT_FORMAT_855, 90: PHONE_ALT_FORMAT_90}
4351

4452
# A mapping from a country code to the region codes which
4553
# denote the country/region represented by that country code.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
"""Auto-generated file, do not edit by hand. 352 metadata"""
2+
from ..phonemetadata import NumberFormat
3+
4+
PHONE_ALT_FORMAT_352 = [NumberFormat(pattern='(\\d{2})(\\d{3})(\\d{3})', format=u'\\1 \\2 \\3')]
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
"""Auto-generated file, do not edit by hand. 359 metadata"""
2+
from ..phonemetadata import NumberFormat
3+
4+
PHONE_ALT_FORMAT_359 = [NumberFormat(pattern='(\\d{3})(\\d{3})(\\d{3})', format=u'\\1 \\2 \\3', leading_digits_pattern=['48|8[7-9]|9[08]'])]
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
"""Auto-generated file, do not edit by hand. 372 metadata"""
2+
from ..phonemetadata import NumberFormat
3+
4+
PHONE_ALT_FORMAT_372 = [NumberFormat(pattern='(\\d{2})(\\d{2})(\\d{3})', format=u'\\1 \\2 \\3', leading_digits_pattern=['[69]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]']), NumberFormat(pattern='(\\d{2})(\\d{3})(\\d{2})', format=u'\\1 \\2 \\3', leading_digits_pattern=['[69]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]'])]
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
"""Auto-generated file, do not edit by hand. 373 metadata"""
2+
from ..phonemetadata import NumberFormat
3+
4+
PHONE_ALT_FORMAT_373 = [NumberFormat(pattern='(\\d{2})(\\d{2})(\\d{2})(\\d{2})', format=u'\\1 \\2 \\3 \\4', leading_digits_pattern=['22|[367]']), NumberFormat(pattern='(\\d{2})(\\d{3})(\\d{3})', format=u'\\1 \\2 \\3', leading_digits_pattern=['[67]'])]
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
"""Auto-generated file, do not edit by hand. 375 metadata"""
2+
from ..phonemetadata import NumberFormat
3+
4+
PHONE_ALT_FORMAT_375 = [NumberFormat(pattern='(\\d{2})(\\d{3})(\\d{2})(\\d{2})', format=u'\\1 \\2 \\3 \\4', leading_digits_pattern=['[1-4]'])]
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
"""Auto-generated file, do not edit by hand. 595 metadata"""
2+
from ..phonemetadata import NumberFormat
3+
4+
PHONE_ALT_FORMAT_595 = [NumberFormat(pattern='(\\d{2})(\\d{2})(\\d{3})', format=u'\\1 \\2 \\3', leading_digits_pattern=['(?:[26]1|3[289]|4[124678]|7[123]|8[1236])'])]
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
"""Auto-generated file, do not edit by hand. 7 metadata"""
2+
from ..phonemetadata import NumberFormat
3+
4+
PHONE_ALT_FORMAT_7 = [NumberFormat(pattern='(\\d{4})(\\d{3})(\\d{3})', format=u'\\1 \\2-\\3', leading_digits_pattern=['[346-9]']), NumberFormat(pattern='(\\d{4})(\\d{2})(\\d{2})(\\d{2})', format=u'\\1 \\2-\\3-\\4', leading_digits_pattern=['[346-9]'])]
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
"""Auto-generated file, do not edit by hand. 855 metadata"""
2+
from ..phonemetadata import NumberFormat
3+
4+
PHONE_ALT_FORMAT_855 = [NumberFormat(pattern='(\\d{2})(\\d{2})(\\d{2})(\\d{2,3})', format=u'\\1 \\2 \\3 \\4')]

python/phonenumbers/data/region_AR.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@
2323
NumberFormat(pattern='(9)(\\d{3})(\\d{3})(\\d{4})', format=u'\\2 15-\\3-\\4', leading_digits_pattern=['9(?:2[234689]|3[3-8])', '9(?:2(?:2[013]|3[067]|49|6[01346]|80|9[147-9])|3(?:36|4[12358]|5[138]|6[24]|7[069]|8[013578]))', '9(?:2(?:2[013]|3[067]|49|6[01346]|80|9(?:[17-9]|4[13479]))|3(?:36|4[12358]|5(?:[18]|3[014-689])|6[24]|7[069]|8(?:[01]|3[013469]|5[0-39]|7[0-2459]|8[0-49])))'], national_prefix_formatting_rule=u'0\\1'),
2424
NumberFormat(pattern='(9)(\\d{4})(\\d{3})(\\d{3})', format=u'\\2 15-\\3-\\4', leading_digits_pattern=['93[58]', '9(?:3(?:53|8[78]))', '9(?:3(?:537|8(?:73|88)))'], national_prefix_formatting_rule=u'0\\1'),
2525
NumberFormat(pattern='(9)(\\d{4})(\\d{2})(\\d{4})', format=u'\\2 15-\\3-\\4', leading_digits_pattern=['9[23]'], national_prefix_formatting_rule=u'0\\1'),
26-
NumberFormat(pattern='(11)(\\d{4})(\\d{4})', format=u'\\1 \\2-\\3', leading_digits_pattern=['1'], national_prefix_formatting_rule=u'0\\1'),
27-
NumberFormat(pattern='(\\d{3})(\\d{3})(\\d{4})', format=u'\\1 \\2-\\3', leading_digits_pattern=['2(?:2[013]|3[067]|49|6[01346]|80|9[147-9])|3(?:36|4[12358]|5[138]|6[24]|7[069]|8[013578])', '2(?:2[013]|3[067]|49|6[01346]|80|9(?:[17-9]|4[13479]))|3(?:36|4[12358]|5(?:[18]|3[0-689])|6[24]|7[069]|8(?:[01]|3[013469]|5[0-39]|7[0-2459]|8[0-49]))'], national_prefix_formatting_rule=u'0\\1'),
28-
NumberFormat(pattern='(\\d{4})(\\d{3})(\\d{3})', format=u'\\1 \\2-\\3', leading_digits_pattern=['3(?:53|8[78])', '3(?:537|8(?:73|88))'], national_prefix_formatting_rule=u'0\\1'),
29-
NumberFormat(pattern='(\\d{4})(\\d{2})(\\d{4})', format=u'\\1 \\2-\\3', leading_digits_pattern=['[23]'], national_prefix_formatting_rule=u'0\\1')],
26+
NumberFormat(pattern='(11)(\\d{4})(\\d{4})', format=u'\\1 \\2-\\3', leading_digits_pattern=['1'], national_prefix_formatting_rule=u'0\\1', national_prefix_optional_when_formatting=True),
27+
NumberFormat(pattern='(\\d{3})(\\d{3})(\\d{4})', format=u'\\1 \\2-\\3', leading_digits_pattern=['2(?:2[013]|3[067]|49|6[01346]|80|9[147-9])|3(?:36|4[12358]|5[138]|6[24]|7[069]|8[013578])', '2(?:2[013]|3[067]|49|6[01346]|80|9(?:[17-9]|4[13479]))|3(?:36|4[12358]|5(?:[18]|3[0-689])|6[24]|7[069]|8(?:[01]|3[013469]|5[0-39]|7[0-2459]|8[0-49]))'], national_prefix_formatting_rule=u'0\\1', national_prefix_optional_when_formatting=True),
28+
NumberFormat(pattern='(\\d{4})(\\d{3})(\\d{3})', format=u'\\1 \\2-\\3', leading_digits_pattern=['3(?:53|8[78])', '3(?:537|8(?:73|88))'], national_prefix_formatting_rule=u'0\\1', national_prefix_optional_when_formatting=True),
29+
NumberFormat(pattern='(\\d{4})(\\d{2})(\\d{4})', format=u'\\1 \\2-\\3', leading_digits_pattern=['[23]'], national_prefix_formatting_rule=u'0\\1', national_prefix_optional_when_formatting=True)],
3030
intl_number_format=[NumberFormat(pattern='([68]\\d{2})(\\d{3})(\\d{4})', format=u'\\1-\\2-\\3', leading_digits_pattern=['[68]']),
3131
NumberFormat(pattern='(9)(11)(\\d{4})(\\d{4})', format=u'\\1 \\2 \\3-\\4', leading_digits_pattern=['911']),
3232
NumberFormat(pattern='(9)(\\d{3})(\\d{3})(\\d{4})', format=u'\\1 \\2 \\3-\\4', leading_digits_pattern=['9(?:2[234689]|3[3-8])', '9(?:2(?:2[013]|3[067]|49|6[01346]|80|9[147-9])|3(?:36|4[12358]|5[138]|6[24]|7[069]|8[013578]))', '9(?:2(?:2[013]|3[067]|49|6[01346]|80|9(?:[17-9]|4[13479]))|3(?:36|4[12358]|5(?:[18]|3[014-689])|6[24]|7[069]|8(?:[01]|3[013469]|5[0-39]|7[0-2459]|8[0-49])))']),
33-
NumberFormat(pattern='(9)(\\d{4})(\\d{3})(\\d{3})', format=u'\\2 15-\\3-\\4', leading_digits_pattern=['93[58]', '9(?:3(?:53|8[78]))', '9(?:3(?:537|8(?:73|88)))']),
33+
NumberFormat(pattern='(9)(\\d{4})(\\d{3})(\\d{3})', format=u'\\1 \\2 \\3-\\4', leading_digits_pattern=['93[58]', '9(?:3(?:53|8[78]))', '9(?:3(?:537|8(?:73|88)))']),
3434
NumberFormat(pattern='(9)(\\d{4})(\\d{2})(\\d{4})', format=u'\\1 \\2 \\3-\\4', leading_digits_pattern=['9[23]']),
3535
NumberFormat(pattern='(11)(\\d{4})(\\d{4})', format=u'\\1 \\2-\\3', leading_digits_pattern=['1']),
3636
NumberFormat(pattern='(\\d{3})(\\d{3})(\\d{4})', format=u'\\1 \\2-\\3', leading_digits_pattern=['2(?:2[013]|3[067]|49|6[01346]|80|9[147-9])|3(?:36|4[12358]|5[138]|6[24]|7[069]|8[013578])', '2(?:2[013]|3[067]|49|6[01346]|80|9(?:[17-9]|4[13479]))|3(?:36|4[12358]|5(?:[18]|3[0-689])|6[24]|7[069]|8(?:[01]|3[013469]|5[0-39]|7[0-2459]|8[0-49]))']),

0 commit comments

Comments
 (0)