Exemple #1
0
 def testEdgeCases(self):
     # Python version extra tests for coverage
     metadataXX = PhoneMetadata(
         id='XX',
         country_code=384,
         international_prefix='011',
         general_desc=PhoneNumberDesc(national_number_pattern='\\d{10}',
                                      possible_number_pattern='\\d{6,10}'),
         fixed_line=PhoneNumberDesc(national_number_pattern='NA',
                                    possible_number_pattern='NA'),
         mobile=PhoneNumberDesc(national_number_pattern='NA',
                                possible_number_pattern='NA'),
         national_prefix=u'0',
         national_prefix_for_parsing=u'0',
         number_format=[
             NumberFormat(pattern='([135][246]|[246][123])(\\d{4})(\\d{4})',
                          format=u'\\1 \\2 \\3',
                          leading_digits_pattern=['[1-59]|[78]0'],
                          national_prefix_formatting_rule=u'(0\\1)')
         ])
     PhoneMetadata.region_metadata['XX'] = metadataXX
     phonenumberutil.SUPPORTED_REGIONS.add("XX")
     phonenumberutil.COUNTRY_CODE_TO_REGION_CODE[384] = ("XX", )
     formatter = AsYouTypeFormatter('XX')
     # A pattern with "|" in it doesn't get formatting
     self.assertEquals('1', formatter.input_digit('1'))
     self.assertEquals('12', formatter.input_digit('2'))
     self.assertEquals('123', formatter.input_digit('3'))
     self.assertEquals('1234', formatter.input_digit('4'))
     del phonenumberutil.COUNTRY_CODE_TO_REGION_CODE[384]
     phonenumberutil.SUPPORTED_REGIONS.remove('XX')
     del PhoneMetadata.region_metadata['XX']
     # Hit internal error arm
     formatter._national_number = ""
     self.assertEquals("", formatter._input_accrued_national_number())
PHONE_METADATA_KI = PhoneMetadata(
    id='KI',
    country_code=686,
    international_prefix='00',
    general_desc=PhoneNumberDesc(national_number_pattern=u'[2-689]\d{4}',
                                 possible_number_pattern=u'\d{5}'),
    fixed_line=PhoneNumberDesc(
        national_number_pattern=u'(?:[234]\d|50|8[1-5])\d{3}',
        possible_number_pattern=u'\d{5}',
        example_number=u'31234'),
    mobile=PhoneNumberDesc(national_number_pattern=u'[69]\d{4}',
                           possible_number_pattern=u'\d{5}',
                           example_number=u'61234'),
    toll_free=PhoneNumberDesc(national_number_pattern=u'NA',
                              possible_number_pattern=u'NA'),
    premium_rate=PhoneNumberDesc(national_number_pattern=u'NA',
                                 possible_number_pattern=u'NA'),
    shared_cost=PhoneNumberDesc(national_number_pattern=u'NA',
                                possible_number_pattern=u'NA'),
    personal_number=PhoneNumberDesc(national_number_pattern=u'NA',
                                    possible_number_pattern=u'NA'),
    voip=PhoneNumberDesc(national_number_pattern=u'NA',
                         possible_number_pattern=u'NA'),
    pager=PhoneNumberDesc(national_number_pattern=u'NA',
                          possible_number_pattern=u'NA'),
    uan=PhoneNumberDesc(national_number_pattern=u'NA',
                        possible_number_pattern=u'NA'),
    no_international_dialling=PhoneNumberDesc(national_number_pattern=u'NA',
                                              possible_number_pattern=u'NA'),
    national_prefix=u'0',
    national_prefix_for_parsing=u'0',
    number_format=[
        NumberFormat(pattern='(\d{5})',
                     format=u'\\1',
                     national_prefix_formatting_rule=u'0\\1')
    ])
PHONE_METADATA_PL = PhoneMetadata(
    id='PL',
    country_code=48,
    international_prefix='0~0',
    general_desc=PhoneNumberDesc(national_number_pattern='[1-9]\\d{8}',
                                 possible_number_pattern='\\d{9}'),
    fixed_line=PhoneNumberDesc(national_number_pattern='[1-9]\\d{8}',
                               possible_number_pattern='\\d{9}'),
    mobile=PhoneNumberDesc(
        national_number_pattern='(?:5[01]|6[069]|7[289]|88)\\d{7}',
        possible_number_pattern='\\d{9}'),
    toll_free=PhoneNumberDesc(national_number_pattern='800\\d{6}',
                              possible_number_pattern='\\d{9}'),
    premium_rate=PhoneNumberDesc(national_number_pattern='70\\d{7}',
                                 possible_number_pattern='\\d{9}'),
    shared_cost=PhoneNumberDesc(national_number_pattern='NA',
                                possible_number_pattern='NA'),
    personal_number=PhoneNumberDesc(national_number_pattern='NA',
                                    possible_number_pattern='NA'),
    voip=PhoneNumberDesc(national_number_pattern='NA',
                         possible_number_pattern='NA'),
    pager=PhoneNumberDesc(national_number_pattern='NA',
                          possible_number_pattern='NA'),
    uan=PhoneNumberDesc(national_number_pattern='NA',
                        possible_number_pattern='NA'),
    no_international_dialling=PhoneNumberDesc(national_number_pattern='NA',
                                              possible_number_pattern='NA'),
    national_prefix=u'0',
    national_prefix_for_parsing=u'0',
    number_format=[
        NumberFormat(pattern='(\\d{2})(\\d{3})(\\d{2})(\\d{2})',
                     format=u'\\1 \\2 \\3 \\4',
                     national_prefix_formatting_rule=u'0\\1')
    ])
"""Auto-generated file, do not edit by hand. GT metadata"""
from phonenumbers import NumberFormat, PhoneNumberDesc, PhoneMetadata

PHONE_METADATA_GT = PhoneMetadata(id='GT', country_code=502, international_prefix='00',
    general_desc=PhoneNumberDesc(national_number_pattern='[2-7]\\d{7}|1[89]\\d{9}', possible_number_pattern='\\d{8}(?:\\d{3})?'),
    fixed_line=PhoneNumberDesc(national_number_pattern='[267][2-9]\\d{6}', possible_number_pattern='\\d{8}', example_number='22456789'),
    mobile=PhoneNumberDesc(national_number_pattern='[345]\\d{7}', possible_number_pattern='\\d{8}', example_number='51234567'),
    toll_free=PhoneNumberDesc(national_number_pattern='18[01]\\d{8}', possible_number_pattern='\\d{11}', example_number='18001112222'),
    premium_rate=PhoneNumberDesc(national_number_pattern='19\\d{9}', possible_number_pattern='\\d{11}', example_number='19001112222'),
    shared_cost=PhoneNumberDesc(national_number_pattern='NA', possible_number_pattern='NA'),
    personal_number=PhoneNumberDesc(national_number_pattern='NA', possible_number_pattern='NA'),
    voip=PhoneNumberDesc(national_number_pattern='NA', possible_number_pattern='NA'),
    pager=PhoneNumberDesc(national_number_pattern='NA', possible_number_pattern='NA'),
    uan=PhoneNumberDesc(national_number_pattern='NA', possible_number_pattern='NA'),
    no_international_dialling=PhoneNumberDesc(national_number_pattern='NA', possible_number_pattern='NA'),
    number_format=[NumberFormat(pattern='(\\d{4})(\\d{4})', format=u'\\1 \\2', leading_digits_pattern=['[2-7]']),
        NumberFormat(pattern='(\\d{4})(\\d{3})(\\d{4})', format=u'\\1 \\2 \\3', leading_digits_pattern=['1'])])
Exemple #5
0
PHONE_METADATA_MN = PhoneMetadata(
    id='MN',
    country_code=976,
    international_prefix='001',
    general_desc=PhoneNumberDesc(
        national_number_pattern='[12]\\d{7,9}|[57-9]\\d{7}',
        possible_number_pattern='\\d{6,10}'),
    fixed_line=PhoneNumberDesc(
        national_number_pattern=
        '[12](?:1\\d|2(?:[1-3]\\d?|7\\d)|3[2-8]\\d{1,2}|4[2-68]\\d{1,2}|5[1-4689]\\d{1,2})\\d{5}|(?:5[0568]|70)\\d{6}',
        possible_number_pattern='\\d{6,10}',
        example_number='70123456'),
    mobile=PhoneNumberDesc(national_number_pattern='(?:8[89]|9[15689])\\d{6}',
                           possible_number_pattern='\\d{8}',
                           example_number='88123456'),
    toll_free=PhoneNumberDesc(national_number_pattern='NA',
                              possible_number_pattern='NA'),
    premium_rate=PhoneNumberDesc(national_number_pattern='NA',
                                 possible_number_pattern='NA'),
    shared_cost=PhoneNumberDesc(national_number_pattern='NA',
                                possible_number_pattern='NA'),
    personal_number=PhoneNumberDesc(national_number_pattern='NA',
                                    possible_number_pattern='NA'),
    voip=PhoneNumberDesc(national_number_pattern='7[569]\\d{6}',
                         possible_number_pattern='\\d{8}',
                         example_number='75123456'),
    pager=PhoneNumberDesc(national_number_pattern='NA',
                          possible_number_pattern='NA'),
    uan=PhoneNumberDesc(national_number_pattern='NA',
                        possible_number_pattern='NA'),
    no_international_dialling=PhoneNumberDesc(national_number_pattern='NA',
                                              possible_number_pattern='NA'),
    national_prefix=u'0',
    national_prefix_for_parsing=u'0',
    number_format=[
        NumberFormat(pattern='([12]\\d)(\\d{2})(\\d{4})',
                     format=u'\\1 \\2 \\3',
                     leading_digits_pattern=['[12]1'],
                     national_prefix_formatting_rule=u'0\\1'),
        NumberFormat(pattern='([12]2\\d)(\\d{5,6})',
                     format=u'\\1 \\2',
                     leading_digits_pattern=['[12]2[1-3]'],
                     national_prefix_formatting_rule=u'0\\1'),
        NumberFormat(pattern='([12]\\d{3})(\\d{5})',
                     format=u'\\1 \\2',
                     leading_digits_pattern=[
                         '[12](?:27|[3-5])', '[12](?:27|[3-5]\\d)2'
                     ],
                     national_prefix_formatting_rule=u'0\\1'),
        NumberFormat(pattern='(\\d{4})(\\d{4})',
                     format=u'\\1 \\2',
                     leading_digits_pattern=['[57-9]'],
                     national_prefix_formatting_rule=u'\\1'),
        NumberFormat(pattern='([12]\\d{4})(\\d{4,5})',
                     format=u'\\1 \\2',
                     leading_digits_pattern=[
                         '[12](?:27|[3-5])', '[12](?:27|[3-5]\\d)[4-9]'
                     ],
                     national_prefix_formatting_rule=u'0\\1')
    ])
PHONE_METADATA_TZ = PhoneMetadata(
    id='TZ',
    country_code=255,
    international_prefix='00[056]',
    general_desc=PhoneNumberDesc(national_number_pattern='\\d{9}',
                                 possible_number_pattern='\\d{7,9}'),
    fixed_line=PhoneNumberDesc(national_number_pattern='2[2-8]\\d{7}',
                               possible_number_pattern='\\d{7,9}',
                               example_number='222345678'),
    mobile=PhoneNumberDesc(national_number_pattern='(?:6[158]|7[1-9])\\d{7}',
                           possible_number_pattern='\\d{9}',
                           example_number='612345678'),
    toll_free=PhoneNumberDesc(national_number_pattern='80[08]\\d{6}',
                              possible_number_pattern='\\d{9}',
                              example_number='800123456'),
    premium_rate=PhoneNumberDesc(national_number_pattern='90\\d{7}',
                                 possible_number_pattern='\\d{9}',
                                 example_number='900123456'),
    shared_cost=PhoneNumberDesc(national_number_pattern='8(?:40|6[01])\\d{6}',
                                possible_number_pattern='\\d{9}',
                                example_number='840123456'),
    personal_number=PhoneNumberDesc(national_number_pattern='NA',
                                    possible_number_pattern='NA'),
    voip=PhoneNumberDesc(national_number_pattern='41\\d{7}',
                         possible_number_pattern='\\d{9}',
                         example_number='412345678'),
    pager=PhoneNumberDesc(national_number_pattern='NA',
                          possible_number_pattern='NA'),
    uan=PhoneNumberDesc(national_number_pattern='NA',
                        possible_number_pattern='NA'),
    no_international_dialling=PhoneNumberDesc(national_number_pattern='NA',
                                              possible_number_pattern='NA'),
    national_prefix=u'0',
    national_prefix_for_parsing=u'0',
    number_format=[
        NumberFormat(pattern='([24]\\d)(\\d{3})(\\d{4})',
                     format=u'\\1 \\2 \\3',
                     leading_digits_pattern=['[24]'],
                     national_prefix_formatting_rule=u'0\\1'),
        NumberFormat(pattern='([67]\\d{2})(\\d{3})(\\d{3})',
                     format=u'\\1 \\2 \\3',
                     leading_digits_pattern=['[67]'],
                     national_prefix_formatting_rule=u'0\\1'),
        NumberFormat(pattern='([89]\\d{2})(\\d{2})(\\d{4})',
                     format=u'\\1 \\2 \\3',
                     leading_digits_pattern=['[89]'],
                     national_prefix_formatting_rule=u'0\\1')
    ])
Exemple #7
0
PHONE_METADATA_AI = PhoneMetadata(
    id='AI',
    country_code=1,
    international_prefix='011',
    general_desc=PhoneNumberDesc(national_number_pattern='[2589]\\d{9}',
                                 possible_number_pattern='\\d{7}(?:\\d{3})?'),
    fixed_line=PhoneNumberDesc(
        national_number_pattern='2644(?:6[12]|9[78])\\d{4}',
        possible_number_pattern='\\d{7}(?:\\d{3})?',
        example_number='2644612345'),
    mobile=PhoneNumberDesc(
        national_number_pattern=
        '264(?:235|476|5(?:3[6-9]|8[1-4])|7(?:29|72))\\d{4}',
        possible_number_pattern='\\d{10}',
        example_number='2642351234'),
    toll_free=PhoneNumberDesc(
        national_number_pattern='8(?:00|55|66|77|88)[2-9]\\d{6}',
        possible_number_pattern='\\d{10}',
        example_number='8002123456'),
    premium_rate=PhoneNumberDesc(national_number_pattern='900[2-9]\\d{6}',
                                 possible_number_pattern='\\d{10}',
                                 example_number='9002123456'),
    shared_cost=PhoneNumberDesc(national_number_pattern='NA',
                                possible_number_pattern='NA'),
    personal_number=PhoneNumberDesc(
        national_number_pattern='5(?:00|33|44)[2-9]\\d{6}',
        possible_number_pattern='\\d{10}',
        example_number='5002345678'),
    voip=PhoneNumberDesc(national_number_pattern='NA',
                         possible_number_pattern='NA'),
    pager=PhoneNumberDesc(national_number_pattern='NA',
                          possible_number_pattern='NA'),
    uan=PhoneNumberDesc(national_number_pattern='NA',
                        possible_number_pattern='NA'),
    no_international_dialling=PhoneNumberDesc(national_number_pattern='NA',
                                              possible_number_pattern='NA'),
    national_prefix=u'1',
    national_prefix_for_parsing=u'1',
    leading_digits='264')
Exemple #8
0
PHONE_METADATA_AT = PhoneMetadata(
    id='AT',
    country_code=43,
    international_prefix='00',
    general_desc=PhoneNumberDesc(national_number_pattern='\\d{4,13}',
                                 possible_number_pattern='\\d{3,13}'),
    fixed_line=PhoneNumberDesc(
        national_number_pattern=
        '1\\d{3,12}|(?:2(?:1[467]|2[134-8]|5[2357]|6[1-46-8]|7[1-8]|8[124-7]|8[1458])|3(?:1[1-8]|3[23568]|4[5-7]|5[1378]|6[1-38]|8[3-68])|4(?:2[1-8]|35|63|7[1368]|8[2457])|5(?:1[27]|2[1-8]|3[357]|4[147]|5[12578]|6[37])|6(?:13|2[1-47]|4[1-35-8]|5[468]|62)|7(?:2[1-8]|3[25]|4[13478]|5[68]|6[16-8]|7[1-6]|9[45]))\\d{3,10}|5(?:0[1-9]|[79]\\d)\\d{2,10}|720\\d{6,10}',
        possible_number_pattern='\\d{3,13}',
        example_number='1234567890'),
    mobile=PhoneNumberDesc(
        national_number_pattern='6(?:44|5[0-3579]|6[013-9]|[7-9]\\d)\\d{4,10}',
        possible_number_pattern='\\d{7,13}',
        example_number='644123456'),
    toll_free=PhoneNumberDesc(national_number_pattern='80[02]\\d{6,10}',
                              possible_number_pattern='\\d{9,13}',
                              example_number='800123456'),
    premium_rate=PhoneNumberDesc(
        national_number_pattern='(?:711|9(?:0[01]|3[019]))\\d{6,10}',
        possible_number_pattern='\\d{9,13}',
        example_number='900123456'),
    shared_cost=PhoneNumberDesc(
        national_number_pattern='8(?:10|2[018])\\d{6,10}',
        possible_number_pattern='\\d{9,13}',
        example_number='810123456'),
    personal_number=PhoneNumberDesc(national_number_pattern='NA',
                                    possible_number_pattern='NA'),
    voip=PhoneNumberDesc(national_number_pattern='780\\d{6,10}',
                         possible_number_pattern='\\d{9,13}',
                         example_number='780123456'),
    pager=PhoneNumberDesc(national_number_pattern='NA',
                          possible_number_pattern='NA'),
    uan=PhoneNumberDesc(national_number_pattern='NA',
                        possible_number_pattern='NA'),
    no_international_dialling=PhoneNumberDesc(national_number_pattern='NA',
                                              possible_number_pattern='NA'),
    national_prefix=u'0',
    national_prefix_for_parsing=u'0',
    number_format=[
        NumberFormat(pattern='([15])(\\d{3,12})',
                     format=u'\\1 \\2',
                     leading_digits_pattern=['1|5[079]'],
                     national_prefix_formatting_rule=u'0\\1'),
        NumberFormat(
            pattern='(\\d{3})(\\d{3,10})',
            format=u'\\1 \\2',
            leading_digits_pattern=[
                '316|46|51|732|6(?:44|5[0-3579]|[6-9])|7(?:1|[28]0)|[89]'
            ],
            national_prefix_formatting_rule=u'0\\1'),
        NumberFormat(
            pattern='(\\d{4})(\\d{3,9})',
            format=u'\\1 \\2',
            leading_digits_pattern=[
                '2|3(?:1[1-578]|[3-8])|4[2378]|5[2-6]|6(?:[12]|4[1-35-9]|5[468])|7(?:2[1-8]|35|4[1-8]|[57-9])'
            ],
            national_prefix_formatting_rule=u'0\\1')
    ])
PHONE_METADATA_MU = PhoneMetadata(
    id='MU',
    country_code=230,
    international_prefix='0(?:[2-7]0|33)',
    general_desc=PhoneNumberDesc(national_number_pattern='[2-9]\\d{6}',
                                 possible_number_pattern='\\d{7}'),
    fixed_line=PhoneNumberDesc(
        national_number_pattern=
        '(?:2(?:[034789]\\d|1[0-8]|2[0-79])|4(?:[013-8]\\d|2[4-7])|[56]\\d{2}|8(?:14|3[129]))\\d{4}',
        possible_number_pattern='\\d{7}',
        example_number='2012345'),
    mobile=PhoneNumberDesc(
        national_number_pattern=
        '(?:25\\d|4(?:2[12389]|9\\d)|7\\d{2}|87[15-7]|9[1-8]\\d)\\d{4}',
        possible_number_pattern='\\d{7}',
        example_number='2512345'),
    toll_free=PhoneNumberDesc(national_number_pattern='80[012]\\d{4}',
                              possible_number_pattern='\\d{7}',
                              example_number='8001234'),
    premium_rate=PhoneNumberDesc(national_number_pattern='30\\d{5}',
                                 possible_number_pattern='\\d{7}',
                                 example_number='3012345'),
    shared_cost=PhoneNumberDesc(national_number_pattern='NA',
                                possible_number_pattern='NA'),
    personal_number=PhoneNumberDesc(national_number_pattern='NA',
                                    possible_number_pattern='NA'),
    voip=PhoneNumberDesc(national_number_pattern='NA',
                         possible_number_pattern='NA'),
    pager=PhoneNumberDesc(national_number_pattern='NA',
                          possible_number_pattern='NA'),
    uan=PhoneNumberDesc(national_number_pattern='NA',
                        possible_number_pattern='NA'),
    no_international_dialling=PhoneNumberDesc(national_number_pattern='NA',
                                              possible_number_pattern='NA'),
    preferred_international_prefix=u'020',
    number_format=[
        NumberFormat(pattern='([2-9]\\d{2})(\\d{4})', format=u'\\1 \\2')
    ])
PHONE_METADATA_TH = PhoneMetadata(
    id='TH',
    country_code=66,
    international_prefix='00',
    general_desc=PhoneNumberDesc(
        national_number_pattern=u'[2-8]\d{7,8}|1\d{9}',
        possible_number_pattern=u'\d{8,10}'),
    fixed_line=PhoneNumberDesc(
        national_number_pattern=u'(?:2[1-9]|3[24-9]|4[2-5]|5[3-6]|7[3-7])\d{6}',
        possible_number_pattern=u'\d{8}',
        example_number=u'21234567'),
    mobile=PhoneNumberDesc(national_number_pattern=u'8\d{8}',
                           possible_number_pattern=u'\d{9}',
                           example_number=u'812345678'),
    toll_free=PhoneNumberDesc(national_number_pattern=u'1800\d{6}',
                              possible_number_pattern=u'\d{10}',
                              example_number=u'1800123456'),
    premium_rate=PhoneNumberDesc(national_number_pattern=u'1900\d{6}',
                                 possible_number_pattern=u'\d{10}',
                                 example_number=u'1900123456'),
    shared_cost=PhoneNumberDesc(national_number_pattern=u'NA',
                                possible_number_pattern=u'NA'),
    personal_number=PhoneNumberDesc(national_number_pattern=u'NA',
                                    possible_number_pattern=u'NA'),
    voip=PhoneNumberDesc(national_number_pattern=u'60\d{7}',
                         possible_number_pattern=u'\d{9}',
                         example_number=u'601234567'),
    pager=PhoneNumberDesc(national_number_pattern=u'NA',
                          possible_number_pattern=u'NA'),
    uan=PhoneNumberDesc(national_number_pattern=u'NA',
                        possible_number_pattern=u'NA'),
    no_international_dialling=PhoneNumberDesc(national_number_pattern=u'NA',
                                              possible_number_pattern=u'NA'),
    national_prefix=u'0',
    national_prefix_for_parsing=u'0',
    number_format=[
        NumberFormat(pattern='(2)(\d{3})(\d{4})',
                     format=u'\\1 \\2 \\3',
                     leading_digits_pattern=['2'],
                     national_prefix_formatting_rule=u'0\\1'),
        NumberFormat(pattern='([3-7]\d)(\d{3})(\d{3,4})',
                     format=u'\\1 \\2 \\3',
                     leading_digits_pattern=['[3-7]'],
                     national_prefix_formatting_rule=u'0\\1'),
        NumberFormat(pattern='(8)(\d{4})(\d{4})',
                     format=u'\\1 \\2 \\3',
                     leading_digits_pattern=['8'],
                     national_prefix_formatting_rule=u'0\\1'),
        NumberFormat(pattern='(1[89]00)(\d{3})(\d{3})',
                     format=u'\\1 \\2 \\3',
                     leading_digits_pattern=['1'],
                     national_prefix_formatting_rule=u'\\1')
    ])
PHONE_METADATA_AR = PhoneMetadata(
    id='AR',
    country_code=54,
    international_prefix='00',
    general_desc=PhoneNumberDesc(national_number_pattern='[1-9]\\d{9,11}',
                                 possible_number_pattern='\\d{6,12}'),
    fixed_line=PhoneNumberDesc(national_number_pattern='[1-9]\\d{9}',
                               possible_number_pattern='\\d{6,10}',
                               example_number='1123456789'),
    mobile=PhoneNumberDesc(
        national_number_pattern=
        '9(?:11[2-9]\\d{7}|(?:2(?:2[013]|37|6[14]|9[179])|3(?:4[1235]|5[138]|8[1578]))[2-9]\\d{6}|\\d{4}[2-9]\\d{5})',
        possible_number_pattern='\\d{6,12}',
        example_number='91123456789'),
    toll_free=PhoneNumberDesc(national_number_pattern='80\\d{8}',
                              possible_number_pattern='\\d{10}',
                              example_number='8012345678'),
    premium_rate=PhoneNumberDesc(national_number_pattern='6(?:0\\d|10)\\d{7}',
                                 possible_number_pattern='\\d{10}',
                                 example_number='6001234567'),
    shared_cost=PhoneNumberDesc(national_number_pattern='NA',
                                possible_number_pattern='NA'),
    personal_number=PhoneNumberDesc(national_number_pattern='NA',
                                    possible_number_pattern='NA'),
    voip=PhoneNumberDesc(national_number_pattern='NA',
                         possible_number_pattern='NA'),
    pager=PhoneNumberDesc(national_number_pattern='NA',
                          possible_number_pattern='NA'),
    uan=PhoneNumberDesc(national_number_pattern='NA',
                        possible_number_pattern='NA'),
    no_international_dialling=PhoneNumberDesc(national_number_pattern='NA',
                                              possible_number_pattern='NA'),
    national_prefix=u'0',
    national_prefix_for_parsing=
    u'0(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1-367])|3(?:[06]2|1[467]|2[02-6]|3[13-8]|[49][2-6]|5[2-8]|7)|47[3-578]|6(?:1|2[2-7]|4[6-8]?|5[125-8])|9(?:0[1-3]|[19]|2\d|3[1-6]|4[0-24-68]|5[2-4]|6[2-6]|72?|8[23]?))|3(?:3(?:2[79]|8[2578])|4(?:0[124-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6\d|7[126]|8[237-9]|9[1-36-8])|5(?:1|2[1245]|3[2-4]?|4[1-46-9]|6[2-4]|7[1-6]|8[2-5]?)|7(?:1[15-8]|2[125]|3[1245]|4[13]|5[124-8]|7[2-57]|8[1-36])|8(?:1|2[125-7]|3[23578]|4[13-6]|5[4-8]?|6[1-357-9]|7[5-8]?|8[4-7]?|9[124])))15)?',
    national_prefix_transform_rule=u'9\\1',
    number_format=[
        NumberFormat(pattern='([68]\\d{2})(\\d{3})(\\d{4})',
                     format=u'\\1-\\2-\\3',
                     leading_digits_pattern=['[68]'],
                     national_prefix_formatting_rule=u'0\\1'),
        NumberFormat(pattern='(9)(11)(\\d{4})(\\d{4})',
                     format=u'\\2 15-\\3-\\4',
                     leading_digits_pattern=['911'],
                     national_prefix_formatting_rule=u'0\\1'),
        NumberFormat(
            pattern='(9)(\\d{3})(\\d{3})(\\d{4})',
            format=u'\\2 15-\\3-\\4',
            leading_digits_pattern=[
                '9(?:2[2369]|3[458])',
                '9(?:2(?:2[013]|37|6[14]|9[179])|3(?:4[1235]|5[138]|8[1578]))'
            ],
            national_prefix_formatting_rule=u'0\\1'),
        NumberFormat(
            pattern='(9)(\\d{4})(\\d{2})(\\d{4})',
            format=u'\\2 15-\\3-\\4',
            leading_digits_pattern=[
                '9(?:2[2-469]|3[3-578])',
                '9(?:2(?:2[24-9]|3[0-69]|47|6[25]|9[02-68])|3(?:3[28]|4[046-9]|5[2467]|7[1-578]|8[23469]))'
            ],
            national_prefix_formatting_rule=u'0\\1'),
        NumberFormat(pattern='(11)(\\d{4})(\\d{4})',
                     format=u'\\1 \\2-\\3',
                     leading_digits_pattern=['1'],
                     national_prefix_formatting_rule=u'0\\1'),
        NumberFormat(
            pattern='(\\d{3})(\\d{3})(\\d{4})',
            format=u'\\1 \\2-\\3',
            leading_digits_pattern=[
                '2(?:2[013]|37|6[14]|9[179])|3(?:4[1235]|5[138]|8[1578])'
            ],
            national_prefix_formatting_rule=u'0\\1'),
        NumberFormat(pattern='(\\d{4})(\\d{2})(\\d{4})',
                     format=u'\\1 \\2-\\3',
                     leading_digits_pattern=['[23]'],
                     national_prefix_formatting_rule=u'0\\1')
    ],
    intl_number_format=[
        NumberFormat(pattern='([68]\\d{2})(\\d{3})(\\d{4})',
                     format=u'\\1-\\2-\\3',
                     leading_digits_pattern=['[68]']),
        NumberFormat(pattern='(9)(11)(\\d{4})(\\d{4})',
                     format=u'\\1 \\2 \\3-\\4',
                     leading_digits_pattern=['911']),
        NumberFormat(
            pattern='(9)(\\d{3})(\\d{3})(\\d{4})',
            format=u'\\1 \\2 \\3-\\4',
            leading_digits_pattern=[
                '9(?:2[2369]|3[458])',
                '9(?:2(?:2[013]|37|6[14]|9[179])|3(?:4[1235]|5[138]|8[1578]))'
            ]),
        NumberFormat(
            pattern='(9)(\\d{4})(\\d{2})(\\d{4})',
            format=u'\\1 \\2 \\3-\\4',
            leading_digits_pattern=[
                '9(?:2[2-469]|3[3-578])',
                '9(?:2(?:2[24-9]|3[0-69]|47|6[25]|9[02-68])|3(?:3[28]|4[046-9]|5[2467]|7[1-578]|8[23469]))'
            ]),
        NumberFormat(pattern='(11)(\\d{4})(\\d{4})',
                     format=u'\\1 \\2-\\3',
                     leading_digits_pattern=['1']),
        NumberFormat(
            pattern='(\\d{3})(\\d{3})(\\d{4})',
            format=u'\\1 \\2-\\3',
            leading_digits_pattern=[
                '2(?:2[013]|37|6[14]|9[179])|3(?:4[1235]|5[138]|8[1578])'
            ]),
        NumberFormat(pattern='(\\d{4})(\\d{2})(\\d{4})',
                     format=u'\\1 \\2-\\3',
                     leading_digits_pattern=['[23]'])
    ])
PHONE_METADATA_KR = PhoneMetadata(
    id='KR',
    country_code=82,
    international_prefix='00(?:[124-68]|[37]\\d{2})',
    general_desc=PhoneNumberDesc(
        national_number_pattern='[1-79]\\d{3,9}|8\\d{8}',
        possible_number_pattern='\\d{4,10}'),
    fixed_line=PhoneNumberDesc(
        national_number_pattern=
        '(?:2|[34][1-3]|5[1-5]|6[1-4])(?:1\\d{2,3}|[2-9]\\d{6,7})',
        possible_number_pattern='\\d{4,10}',
        example_number='22123456'),
    mobile=PhoneNumberDesc(national_number_pattern='1[0-25-9]\\d{7,8}',
                           possible_number_pattern='\\d{9,10}',
                           example_number='1023456789'),
    toll_free=PhoneNumberDesc(national_number_pattern='80\\d{7}',
                              possible_number_pattern='\\d{9}',
                              example_number='801234567'),
    premium_rate=PhoneNumberDesc(national_number_pattern='60[2-9]\\d{6}',
                                 possible_number_pattern='\\d{9}',
                                 example_number='602345678'),
    shared_cost=PhoneNumberDesc(national_number_pattern='NA',
                                possible_number_pattern='NA'),
    personal_number=PhoneNumberDesc(national_number_pattern='50\\d{8}',
                                    possible_number_pattern='\\d{10}',
                                    example_number='5012345678'),
    voip=PhoneNumberDesc(national_number_pattern='70\\d{8}',
                         possible_number_pattern='\\d{10}',
                         example_number='7012345678'),
    pager=PhoneNumberDesc(national_number_pattern='NA',
                          possible_number_pattern='NA'),
    uan=PhoneNumberDesc(national_number_pattern='NA',
                        possible_number_pattern='NA'),
    no_international_dialling=PhoneNumberDesc(national_number_pattern='NA',
                                              possible_number_pattern='NA'),
    national_prefix=u'0',
    national_prefix_for_parsing=u'0(8[1-46-8]|85\d{2})?',
    number_format=[
        NumberFormat(pattern='(\\d{2})(\\d{4})(\\d{4})',
                     format=u'\\1-\\2-\\3',
                     leading_digits_pattern=[
                         '1(?:0|1[19]|[69]9|5[458])|[57]0',
                         '1(?:0|1[19]|[69]9|5(?:44|59|8))|[57]0'
                     ],
                     national_prefix_formatting_rule=u'0\\1'),
        NumberFormat(
            pattern='(\\d{2})(\\d{3})(\\d{4})',
            format=u'\\1-\\2-\\3',
            leading_digits_pattern=[
                '1(?:[169][2-8]|[78]|5[1-4])|[68]0|[3-9][1-9][2-9]',
                '1(?:[169][2-8]|[78]|5(?:[1-3]|4[56]))|[68]0|[3-9][1-9][2-9]'
            ],
            national_prefix_formatting_rule=u'0\\1'),
        NumberFormat(pattern='(\\d{3})(\\d)(\\d{4})',
                     format=u'\\1-\\2-\\3',
                     leading_digits_pattern=['131', '1312'],
                     national_prefix_formatting_rule=u'0\\1'),
        NumberFormat(pattern='(\\d{3})(\\d{2})(\\d{4})',
                     format=u'\\1-\\2-\\3',
                     leading_digits_pattern=['131', '131[13-9]'],
                     national_prefix_formatting_rule=u'0\\1'),
        NumberFormat(pattern='(\\d{3})(\\d{3})(\\d{4})',
                     format=u'\\1-\\2-\\3',
                     leading_digits_pattern=['13[2-9]'],
                     national_prefix_formatting_rule=u'0\\1'),
        NumberFormat(pattern='(\\d{2})(\\d{2})(\\d{3})(\\d{4})',
                     format=u'\\1-\\2-\\3-\\4',
                     leading_digits_pattern=['30'],
                     national_prefix_formatting_rule=u'0\\1'),
        NumberFormat(pattern='(\\d)(\\d{4})(\\d{4})',
                     format=u'\\1-\\2-\\3',
                     leading_digits_pattern=[
                         '2(?:[26]|3[0-467])',
                         '2(?:[26]|3(?:01|1[45]|2[17-9]|39|4|6[67]|7[078]))'
                     ],
                     national_prefix_formatting_rule=u'0\\1'),
        NumberFormat(
            pattern='(\\d)(\\d{3})(\\d{4})',
            format=u'\\1-\\2-\\3',
            leading_digits_pattern=[
                '2(?:3[0-35-9]|[457-9])',
                '2(?:3(?:0[02-9]|1[0-36-9]|2[02-6]|3[0-8]|6[0-589]|7[1-69]|[589])|[457-9])'
            ],
            national_prefix_formatting_rule=u'0\\1'),
        NumberFormat(pattern='(\\d)(\\d{3})',
                     format=u'\\1-\\2',
                     leading_digits_pattern=[
                         '21[0-46-9]', '21(?:[0-247-9]|3[124]|6[1269])'
                     ],
                     national_prefix_formatting_rule=u'0\\1'),
        NumberFormat(
            pattern='(\\d)(\\d{4})',
            format=u'\\1-\\2',
            leading_digits_pattern=['21[36]', '21(?:3[035-9]|6[03-578])'],
            national_prefix_formatting_rule=u'0\\1'),
        NumberFormat(pattern='(\\d{2})(\\d{3})',
                     format=u'\\1-\\2',
                     leading_digits_pattern=[
                         '[3-9][1-9]1', '[3-9][1-9]1(?:[0-46-9])',
                         '[3-9][1-9]1(?:[0-247-9]|3[124]|6[1269])'
                     ],
                     national_prefix_formatting_rule=u'0\\1'),
        NumberFormat(pattern='(\\d{2})(\\d{4})',
                     format=u'\\1-\\2',
                     leading_digits_pattern=[
                         '[3-9][1-9]1', '[3-9][1-9]1[36]',
                         '[3-9][1-9]1(?:3[035-9]|6[03-578])'
                     ],
                     national_prefix_formatting_rule=u'0\\1')
    ])
PHONE_METADATA_AE = PhoneMetadata(
    id='AE',
    country_code=971,
    international_prefix='00',
    general_desc=PhoneNumberDesc(
        national_number_pattern='[2-79]\\d{7,8}|800\\d{2,9}',
        possible_number_pattern='\\d{5,12}'),
    fixed_line=PhoneNumberDesc(
        national_number_pattern='(?:[2-4679][2-8]\\d|600[25])\\d{5}',
        possible_number_pattern='\\d{7,9}',
        example_number='22345678'),
    mobile=PhoneNumberDesc(national_number_pattern='5[056]\\d{7}',
                           possible_number_pattern='\\d{9}',
                           example_number='501234567'),
    toll_free=PhoneNumberDesc(national_number_pattern='400\\d{6}|800\\d{2,9}',
                              possible_number_pattern='\\d{5,12}',
                              example_number='800123456'),
    premium_rate=PhoneNumberDesc(national_number_pattern='900[02]\\d{5}',
                                 possible_number_pattern='\\d{9}',
                                 example_number='900234567'),
    shared_cost=PhoneNumberDesc(national_number_pattern='700[05]\\d{5}',
                                possible_number_pattern='\\d{9}',
                                example_number='700012345'),
    personal_number=PhoneNumberDesc(national_number_pattern='NA',
                                    possible_number_pattern='NA'),
    voip=PhoneNumberDesc(national_number_pattern='NA',
                         possible_number_pattern='NA'),
    pager=PhoneNumberDesc(national_number_pattern='NA',
                          possible_number_pattern='NA'),
    uan=PhoneNumberDesc(national_number_pattern='NA',
                        possible_number_pattern='NA'),
    no_international_dialling=PhoneNumberDesc(national_number_pattern='NA',
                                              possible_number_pattern='NA'),
    national_prefix=u'0',
    national_prefix_for_parsing=u'0',
    number_format=[
        NumberFormat(pattern='([2-4679])(\\d{3})(\\d{4})',
                     format=u'\\1 \\2 \\3',
                     leading_digits_pattern=['[2-4679][2-8]'],
                     national_prefix_formatting_rule=u'0\\1'),
        NumberFormat(pattern='(5[056])(\\d{3})(\\d{4})',
                     format=u'\\1 \\2 \\3',
                     leading_digits_pattern=['5'],
                     national_prefix_formatting_rule=u'0\\1'),
        NumberFormat(pattern='([4679]00)(\\d)(\\d{5})',
                     format=u'\\1 \\2 \\3',
                     leading_digits_pattern=['[4679]0'],
                     national_prefix_formatting_rule=u'\\1'),
        NumberFormat(pattern='(800)(\\d{2,9})',
                     format=u'\\1 \\2',
                     leading_digits_pattern=['8'],
                     national_prefix_formatting_rule=u'\\1')
    ])
Exemple #14
0
"""Auto-generated file, do not edit by hand. GU metadata"""
from phonenumbers import NumberFormat, PhoneNumberDesc, PhoneMetadata

PHONE_METADATA_GU = PhoneMetadata(id='GU', country_code=1, international_prefix='011',
    general_desc=PhoneNumberDesc(national_number_pattern=u'[5689]\d{9}', possible_number_pattern=u'\d{7}(?:\d{3})?'),
    fixed_line=PhoneNumberDesc(national_number_pattern=u'671(?:3(?:00|3[39]|4[349]|55|6[26])|4(?:56|7[1-9]|8[23678])|5(?:55|6[2-5]|88)|6(?:3[2-578]|4[24-9]|5[34]|78|8[5-9])|7(?:[079]7|2[0167]|3[45]|8[789])|8(?:[2-5789]8|6[48])|9(?:2[29]|6[79]|7[179]|8[789]|9[78]))\d{4}', possible_number_pattern=u'\d{7}(?:\d{3})?', example_number=u'6713001234'),
    mobile=PhoneNumberDesc(national_number_pattern=u'671(?:3(?:00|3[39]|4[349]|55|6[26])|4(?:56|7[1-9]|8[23678])|5(?:55|6[2-5]|88)|6(?:3[2-578]|4[24-9]|5[34]|78|8[5-9])|7(?:[079]7|2[0167]|3[45]|8[789])|8(?:[2-5789]8|6[48])|9(?:2[29]|6[79]|7[179]|8[789]|9[78]))\d{4}', possible_number_pattern=u'\d{7}(?:\d{3})?', example_number=u'6713001234'),
    toll_free=PhoneNumberDesc(national_number_pattern=u'8(?:00|55|66|77|88)[2-9]\d{6}', possible_number_pattern=u'\d{10}', example_number=u'8002123456'),
    premium_rate=PhoneNumberDesc(national_number_pattern=u'900[2-9]\d{6}', possible_number_pattern=u'\d{10}', example_number=u'9002123456'),
    shared_cost=PhoneNumberDesc(national_number_pattern=u'NA', possible_number_pattern=u'NA'),
    personal_number=PhoneNumberDesc(national_number_pattern=u'5(?:00|33|44)[2-9]\d{6}', possible_number_pattern=u'\d{10}', example_number=u'5002345678'),
    voip=PhoneNumberDesc(national_number_pattern=u'NA', possible_number_pattern=u'NA'),
    pager=PhoneNumberDesc(national_number_pattern=u'NA', possible_number_pattern=u'NA'),
    uan=PhoneNumberDesc(national_number_pattern=u'NA', possible_number_pattern=u'NA'),
    no_international_dialling=PhoneNumberDesc(national_number_pattern=u'NA', possible_number_pattern=u'NA'),
    national_prefix=u'1',
    national_prefix_for_parsing=u'1',
    leading_digits='671')
Exemple #15
0
PHONE_METADATA_DJ = PhoneMetadata(
    id='DJ',
    country_code=253,
    international_prefix='00',
    general_desc=PhoneNumberDesc(national_number_pattern=u'[1-8]\d{5}',
                                 possible_number_pattern=u'\d{6}'),
    fixed_line=PhoneNumberDesc(
        national_number_pattern=u'(?:1[05]|[2-5]\d)\d{4}',
        possible_number_pattern=u'\d{6}',
        example_number=u'251234'),
    mobile=PhoneNumberDesc(national_number_pattern=u'[6-8]\d{5}',
                           possible_number_pattern=u'\d{6}',
                           example_number=u'601234'),
    toll_free=PhoneNumberDesc(national_number_pattern=u'NA',
                              possible_number_pattern=u'NA'),
    premium_rate=PhoneNumberDesc(national_number_pattern=u'NA',
                                 possible_number_pattern=u'NA'),
    shared_cost=PhoneNumberDesc(national_number_pattern=u'NA',
                                possible_number_pattern=u'NA'),
    personal_number=PhoneNumberDesc(national_number_pattern=u'NA',
                                    possible_number_pattern=u'NA'),
    voip=PhoneNumberDesc(national_number_pattern=u'NA',
                         possible_number_pattern=u'NA'),
    pager=PhoneNumberDesc(national_number_pattern=u'NA',
                          possible_number_pattern=u'NA'),
    uan=PhoneNumberDesc(national_number_pattern=u'NA',
                        possible_number_pattern=u'NA'),
    no_international_dialling=PhoneNumberDesc(national_number_pattern=u'NA',
                                              possible_number_pattern=u'NA'),
    number_format=[
        NumberFormat(pattern='(\d{2})(\d{2})(\d{2})', format=u'\\1 \\2 \\3')
    ])
"""Auto-generated file, do not edit by hand. SY metadata"""
from phonenumbers import NumberFormat, PhoneNumberDesc, PhoneMetadata

PHONE_METADATA_SY = PhoneMetadata(id='SY', country_code=963, international_prefix='00',
    general_desc=PhoneNumberDesc(national_number_pattern=u'[1-59]\d{7,8}', possible_number_pattern=u'\d{6,9}'),
    fixed_line=PhoneNumberDesc(national_number_pattern=u'(?:1(?:1\d?|4\d|[2356])|2[1-35]|3(?:1\d|[34])|4[13]|5[1-3])\d{6}', possible_number_pattern=u'\d{6,9}', example_number=u'112345678'),
    mobile=PhoneNumberDesc(national_number_pattern=u'9(?:3[23]|4[457]|55|6[67]|88|9[19])\d{6}', possible_number_pattern=u'\d{9}', example_number=u'944567890'),
    toll_free=PhoneNumberDesc(national_number_pattern=u'NA', possible_number_pattern=u'NA'),
    premium_rate=PhoneNumberDesc(national_number_pattern=u'NA', possible_number_pattern=u'NA'),
    shared_cost=PhoneNumberDesc(national_number_pattern=u'NA', possible_number_pattern=u'NA'),
    personal_number=PhoneNumberDesc(national_number_pattern=u'NA', possible_number_pattern=u'NA'),
    voip=PhoneNumberDesc(national_number_pattern=u'NA', possible_number_pattern=u'NA'),
    pager=PhoneNumberDesc(national_number_pattern=u'NA', possible_number_pattern=u'NA'),
    uan=PhoneNumberDesc(national_number_pattern=u'NA', possible_number_pattern=u'NA'),
    no_international_dialling=PhoneNumberDesc(national_number_pattern=u'NA', possible_number_pattern=u'NA'),
    national_prefix=u'0',
    national_prefix_for_parsing=u'0',
    number_format=[NumberFormat(pattern='(\d{2})(\d{3})(\d{3,4})', format=u'\\1 \\2 \\3', leading_digits_pattern=['[1-5]'], national_prefix_formatting_rule=u'0\\1'),
        NumberFormat(pattern='(9[3-689])(\d{4})(\d{3})', format=u'\\1 \\2 \\3', leading_digits_pattern=['9'], national_prefix_formatting_rule=u'0\\1')])
Exemple #17
0
"""Auto-generated file, do not edit by hand. PS metadata"""
from phonenumbers import NumberFormat, PhoneNumberDesc, PhoneMetadata

PHONE_METADATA_PS = PhoneMetadata(id='PS', country_code=970, international_prefix='00',
    general_desc=PhoneNumberDesc(national_number_pattern='[24589]\\d{7,8}|1(?:[78]\\d{8}|[49]\\d{2,3})', possible_number_pattern='\\d{4,10}'),
    fixed_line=PhoneNumberDesc(national_number_pattern='(?:22[234789]|42[45]|82[01458]|92[369])\\d{5}', possible_number_pattern='\\d{7,8}', example_number='22234567'),
    mobile=PhoneNumberDesc(national_number_pattern='5[69]\\d{7}', possible_number_pattern='\\d{9}', example_number='599123456'),
    toll_free=PhoneNumberDesc(national_number_pattern='1800\\d{6}', possible_number_pattern='\\d{10}', example_number='1800123456'),
    premium_rate=PhoneNumberDesc(national_number_pattern='1(?:4|9\\d)\\d{2}', possible_number_pattern='\\d{4,5}', example_number='19123'),
    shared_cost=PhoneNumberDesc(national_number_pattern='1700\\d{6}', possible_number_pattern='\\d{10}', example_number='1700123456'),
    personal_number=PhoneNumberDesc(national_number_pattern='NA', possible_number_pattern='NA'),
    voip=PhoneNumberDesc(national_number_pattern='NA', possible_number_pattern='NA'),
    pager=PhoneNumberDesc(national_number_pattern='NA', possible_number_pattern='NA'),
    uan=PhoneNumberDesc(national_number_pattern='NA', possible_number_pattern='NA'),
    no_international_dialling=PhoneNumberDesc(national_number_pattern='NA', possible_number_pattern='NA'),
    national_prefix=u'0',
    national_prefix_for_parsing=u'0',
    number_format=[NumberFormat(pattern='([2489])(2\\d{2})(\\d{4})', format=u'\\1 \\2 \\3', leading_digits_pattern=['[2489]'], national_prefix_formatting_rule=u'0\\1'),
        NumberFormat(pattern='(5[69]\\d)(\\d{3})(\\d{3})', format=u'\\1 \\2 \\3', leading_digits_pattern=['5'], national_prefix_formatting_rule=u'0\\1'),
        NumberFormat(pattern='(1[78]00)(\\d{3})(\\d{3})', format=u'\\1 \\2 \\3', leading_digits_pattern=['1[78]'], national_prefix_formatting_rule=u'\\1')])
PHONE_METADATA_KW = PhoneMetadata(
    id='KW',
    country_code=965,
    international_prefix='00',
    general_desc=PhoneNumberDesc(national_number_pattern='[12569]\\d{6,7}',
                                 possible_number_pattern='\\d{7,8}'),
    fixed_line=PhoneNumberDesc(
        national_number_pattern=
        '(?:18\\d|2(?:[23]\\d{2}|4[1-35-9]\\d|5(?:0[034]|[2-46]\\d|5[1-3]|7[1-7])))\\d{4}',
        possible_number_pattern='\\d{7,8}',
        example_number='22345678'),
    mobile=PhoneNumberDesc(
        national_number_pattern=
        '(?:5(?:0[0-25]|5\\d)|6(?:0[034679]|5[015-9]|6\\d|7[067]|99)|9(?:0[09]|4[049]|66|[79]\\d))\\d{5}',
        possible_number_pattern='\\d{8}',
        example_number='50012345'),
    toll_free=PhoneNumberDesc(national_number_pattern='NA',
                              possible_number_pattern='NA'),
    premium_rate=PhoneNumberDesc(national_number_pattern='NA',
                                 possible_number_pattern='NA'),
    shared_cost=PhoneNumberDesc(national_number_pattern='NA',
                                possible_number_pattern='NA'),
    personal_number=PhoneNumberDesc(national_number_pattern='NA',
                                    possible_number_pattern='NA'),
    voip=PhoneNumberDesc(national_number_pattern='NA',
                         possible_number_pattern='NA'),
    pager=PhoneNumberDesc(national_number_pattern='NA',
                          possible_number_pattern='NA'),
    uan=PhoneNumberDesc(national_number_pattern='NA',
                        possible_number_pattern='NA'),
    no_international_dialling=PhoneNumberDesc(national_number_pattern='NA',
                                              possible_number_pattern='NA'),
    number_format=[
        NumberFormat(pattern='(\\d{4})(\\d{3,4})',
                     format=u'\\1 \\2',
                     leading_digits_pattern=['[1269]'],
                     national_prefix_formatting_rule=u'\\1'),
        NumberFormat(pattern='(5[05]\\d)(\\d{5})',
                     format=u'\\1 \\2',
                     leading_digits_pattern=['5'],
                     national_prefix_formatting_rule=u'\\1')
    ])
Exemple #19
0
"""Auto-generated file, do not edit by hand. FM metadata"""
from phonenumbers import NumberFormat, PhoneNumberDesc, PhoneMetadata

PHONE_METADATA_FM = PhoneMetadata(id='FM', country_code=691, international_prefix='00',
    general_desc=PhoneNumberDesc(national_number_pattern='[39]\\d{6}', possible_number_pattern='\\d{7}'),
    fixed_line=PhoneNumberDesc(national_number_pattern='3[2357]0[1-9]\\d{3}|9[2-6]\\d{5}', possible_number_pattern='\\d{7}', example_number='3201234'),
    mobile=PhoneNumberDesc(national_number_pattern='3[2357]0[1-9]\\d{3}|9[2-7]\\d{5}', possible_number_pattern='\\d{7}', example_number='3501234'),
    toll_free=PhoneNumberDesc(national_number_pattern='NA', possible_number_pattern='NA'),
    premium_rate=PhoneNumberDesc(national_number_pattern='NA', possible_number_pattern='NA'),
    shared_cost=PhoneNumberDesc(national_number_pattern='NA', possible_number_pattern='NA'),
    personal_number=PhoneNumberDesc(national_number_pattern='NA', possible_number_pattern='NA'),
    voip=PhoneNumberDesc(national_number_pattern='NA', possible_number_pattern='NA'),
    pager=PhoneNumberDesc(national_number_pattern='NA', possible_number_pattern='NA'),
    uan=PhoneNumberDesc(national_number_pattern='NA', possible_number_pattern='NA'),
    no_international_dialling=PhoneNumberDesc(national_number_pattern='NA', possible_number_pattern='NA'),
    number_format=[NumberFormat(pattern='(\\d{3})(\\d{4})', format=u'\\1 \\2')])
PHONE_METADATA_CY = PhoneMetadata(
    id='CY',
    country_code=357,
    international_prefix='00',
    general_desc=PhoneNumberDesc(national_number_pattern=u'[27-9]\d{7}',
                                 possible_number_pattern=u'\d{8}'),
    fixed_line=PhoneNumberDesc(national_number_pattern=u'2[2-6]\d{6}',
                               possible_number_pattern=u'\d{8}',
                               example_number=u'22345678'),
    mobile=PhoneNumberDesc(
        national_number_pattern=u'7777\d{4}|9(?:[69]\d|7[67])\d{5}',
        possible_number_pattern=u'\d{8}',
        example_number=u'96123456'),
    toll_free=PhoneNumberDesc(national_number_pattern=u'8000\d{4}',
                              possible_number_pattern=u'\d{8}',
                              example_number=u'80001234'),
    premium_rate=PhoneNumberDesc(national_number_pattern=u'9009\d{4}',
                                 possible_number_pattern=u'\d{8}',
                                 example_number=u'90091234'),
    shared_cost=PhoneNumberDesc(national_number_pattern=u'NA',
                                possible_number_pattern=u'NA'),
    personal_number=PhoneNumberDesc(national_number_pattern=u'700\d{5}',
                                    possible_number_pattern=u'\d{8}',
                                    example_number=u'70012345'),
    voip=PhoneNumberDesc(national_number_pattern=u'NA',
                         possible_number_pattern=u'NA'),
    pager=PhoneNumberDesc(national_number_pattern=u'NA',
                          possible_number_pattern=u'NA'),
    uan=PhoneNumberDesc(national_number_pattern=u'NA',
                        possible_number_pattern=u'NA'),
    no_international_dialling=PhoneNumberDesc(national_number_pattern=u'NA',
                                              possible_number_pattern=u'NA'),
    number_format=[
        NumberFormat(pattern='([27-9]\d)(\d{6})', format=u'\\1 \\2')
    ])
Exemple #21
0
PHONE_METADATA_UA = PhoneMetadata(
    id='UA',
    country_code=380,
    international_prefix='0~0',
    general_desc=PhoneNumberDesc(national_number_pattern=u'[3-689]\d{8}',
                                 possible_number_pattern=u'\d{5,9}'),
    fixed_line=PhoneNumberDesc(
        national_number_pattern=u'(?:3[1-8]|4[13-8]|5[1-7]|6[12459])\d{7}',
        possible_number_pattern=u'\d{5,9}',
        example_number=u'311234567'),
    mobile=PhoneNumberDesc(
        national_number_pattern=u'(?:39|50|6[36-8]|9[1-9])\d{7}',
        possible_number_pattern=u'\d{9}',
        example_number=u'391234567'),
    toll_free=PhoneNumberDesc(national_number_pattern=u'800\d{6}',
                              possible_number_pattern=u'\d{9}',
                              example_number=u'800123456'),
    premium_rate=PhoneNumberDesc(national_number_pattern=u'900\d{6}',
                                 possible_number_pattern=u'\d{9}',
                                 example_number=u'900123456'),
    shared_cost=PhoneNumberDesc(national_number_pattern=u'NA',
                                possible_number_pattern=u'NA'),
    personal_number=PhoneNumberDesc(national_number_pattern=u'NA',
                                    possible_number_pattern=u'NA'),
    voip=PhoneNumberDesc(national_number_pattern=u'NA',
                         possible_number_pattern=u'NA'),
    pager=PhoneNumberDesc(national_number_pattern=u'NA',
                          possible_number_pattern=u'NA'),
    uan=PhoneNumberDesc(national_number_pattern=u'NA',
                        possible_number_pattern=u'NA'),
    no_international_dialling=PhoneNumberDesc(national_number_pattern=u'NA',
                                              possible_number_pattern=u'NA'),
    national_prefix=u'0',
    national_prefix_for_parsing=u'0',
    number_format=[
        NumberFormat(
            pattern='([3-69]\d)(\d{3})(\d{4})',
            format=u'\\1 \\2 \\3',
            leading_digits_pattern=[
                '39|4(?:[45][0-5]|87)|5(?:0|6[37]|7[37])|6[36-8]|9[1-9]',
                '39|4(?:[45][0-5]|87)|5(?:0|6(?:3[14-7]|7)|7[37])|6[36-8]|9[1-9]'
            ],
            national_prefix_formatting_rule=u'0\\1'),
        NumberFormat(
            pattern='([3-689]\d{2})(\d{3})(\d{3})',
            format=u'\\1 \\2 \\3',
            leading_digits_pattern=[
                '3[1-8]2|4[1378]2|5(?:[12457]2|6[24])|6(?:[49]2|[12][29]|5[24])|8|90',
                '3(?:[1-46-8]2[013-9]|52)|4[1378]2|5(?:[12457]2|6[24])|6(?:[49]2|[12][29]|5[24])|8|90'
            ],
            national_prefix_formatting_rule=u'0\\1'),
        NumberFormat(
            pattern='([3-6]\d{3})(\d{5})',
            format=u'\\1 \\2',
            leading_digits_pattern=[
                '3(?:5[013-9]|[1-46-8])|4(?:[137][013-9]|6|[45][6-9]|8[4-6])|5(?:[1245][013-9]|6[0135-9]|3|7[4-6])|6(?:[49][013-9]|5[0135-9]|[12][13-8])',
                '3(?:5[013-9]|[1-46-8](?:22|[013-9]))|4(?:[137][013-9]|6|[45][6-9]|8[4-6])|5(?:[1245][013-9]|6(?:3[02389]|[015689])|3|7[4-6])|6(?:[49][013-9]|5[0135-9]|[12][13-8])'
            ],
            national_prefix_formatting_rule=u'0\\1')
    ])
PHONE_METADATA_SI = PhoneMetadata(
    id='SI',
    country_code=386,
    international_prefix='00',
    general_desc=PhoneNumberDesc(
        national_number_pattern=u'[1-7]\d{6,7}|[89]\d{4,7}',
        possible_number_pattern=u'\d{5,8}'),
    fixed_line=PhoneNumberDesc(
        national_number_pattern=u'(?:1\d|2[2-8]|3[4-8]|4[24-8]|[57][3-8])\d{6}',
        possible_number_pattern=u'\d{7,8}',
        example_number=u'11234567'),
    mobile=PhoneNumberDesc(
        national_number_pattern=u'(?:[37][01]|4[019]|51|64)\d{6}',
        possible_number_pattern=u'\d{8}',
        example_number=u'31234567'),
    toll_free=PhoneNumberDesc(national_number_pattern=u'80\d{4,6}',
                              possible_number_pattern=u'\d{6,8}',
                              example_number=u'80123456'),
    premium_rate=PhoneNumberDesc(
        national_number_pattern=u'90\d{4,6}|89[1-3]\d{2,5}',
        possible_number_pattern=u'\d{5,8}',
        example_number=u'90123456'),
    shared_cost=PhoneNumberDesc(national_number_pattern=u'NA',
                                possible_number_pattern=u'NA'),
    personal_number=PhoneNumberDesc(national_number_pattern=u'NA',
                                    possible_number_pattern=u'NA'),
    voip=PhoneNumberDesc(national_number_pattern=u'(?:59|8[1-3])\d{6}',
                         possible_number_pattern=u'\d{8}',
                         example_number=u'59012345'),
    pager=PhoneNumberDesc(national_number_pattern=u'NA',
                          possible_number_pattern=u'NA'),
    uan=PhoneNumberDesc(national_number_pattern=u'NA',
                        possible_number_pattern=u'NA'),
    no_international_dialling=PhoneNumberDesc(national_number_pattern=u'NA',
                                              possible_number_pattern=u'NA'),
    national_prefix=u'0',
    national_prefix_for_parsing=u'0',
    number_format=[
        NumberFormat(
            pattern='(\d)(\d{3})(\d{2})(\d{2})',
            format=u'\\1 \\2 \\3 \\4',
            leading_digits_pattern=['[12]|3[4-8]|4[24-8]|5[3-8]|7[3-8]'],
            national_prefix_formatting_rule=u'(0\\1)'),
        NumberFormat(pattern='([3-7]\d)(\d{3})(\d{3})',
                     format=u'\\1 \\2 \\3',
                     leading_digits_pattern=['[37][01]|4[019]|51|64'],
                     national_prefix_formatting_rule=u'0\\1'),
        NumberFormat(pattern='([89][09])(\d{3,6})',
                     format=u'\\1 \\2',
                     leading_digits_pattern=['[89][09]'],
                     national_prefix_formatting_rule=u'0\\1'),
        NumberFormat(pattern='([58]\d{2})(\d{5})',
                     format=u'\\1 \\2',
                     leading_digits_pattern=['59|8[1-3]'],
                     national_prefix_formatting_rule=u'0\\1')
    ])
Exemple #23
0
PHONE_METADATA_KZ = PhoneMetadata(
    id='KZ',
    country_code=7,
    international_prefix='8~10',
    general_desc=PhoneNumberDesc(
        national_number_pattern=u'(?:7\d{2}|80[09])\d{7}',
        possible_number_pattern=u'\d{10}'),
    fixed_line=PhoneNumberDesc(
        national_number_pattern=
        u'7(?:1(?:0(?:[23]\d|4[023]|59|63)|1(?:[23]\d|4[0-79]|59)|2(?:[23]\d|59)|3(?:2\d|3[1-79]|4[0-35-9]|59)|4(?:2\d|3[013-79]|4[0-8]|5[1-79])|5(?:2\d|3[1-8]|4[1-7]|59)|6(?:2\d|[34]\d|5[19]|61)|72\d|8(?:[27]\d|3[1-46-9]|4[0-5]|))|2(?:1(?:[23]\d|4[46-9]|5[3469])|2(?:2\d|3[0679]|46|5[12679]|)|3(?:[234]\d|5[139]|)|4(?:2\d|3[1235-9]|59)|5(?:[23]\d|4[01246-8]|59|61)|6(?:2\d|3[1-9]|4[0-4]|59)|7(?:[23]\d|40|5[279]|7\d)|8(?:[23]\d|4[0-3]|59)|9(?:2\d|3[124578]|59))|3622)\d{5}',
        possible_number_pattern=u'\d{10}',
        example_number=u'7123456789'),
    mobile=PhoneNumberDesc(national_number_pattern=
                           u'7(?:0[01257]\d{2}|6[02-4]\d{2}|7[157]\d{2})\d{5}',
                           possible_number_pattern=u'\d{10}',
                           example_number=u'7710009998'),
    toll_free=PhoneNumberDesc(national_number_pattern=u'800\d{7}',
                              possible_number_pattern=u'\d{10}',
                              example_number=u'8001234567'),
    premium_rate=PhoneNumberDesc(national_number_pattern=u'809\d{7}',
                                 possible_number_pattern=u'\d{10}',
                                 example_number=u'8091234567'),
    shared_cost=PhoneNumberDesc(national_number_pattern=u'NA',
                                possible_number_pattern=u'NA'),
    personal_number=PhoneNumberDesc(national_number_pattern=u'NA',
                                    possible_number_pattern=u'NA'),
    voip=PhoneNumberDesc(national_number_pattern=u'751\d{7}',
                         possible_number_pattern=u'\d{10}',
                         example_number=u'7511234567'),
    pager=PhoneNumberDesc(national_number_pattern=u'NA',
                          possible_number_pattern=u'NA'),
    uan=PhoneNumberDesc(national_number_pattern=u'NA',
                        possible_number_pattern=u'NA'),
    no_international_dialling=PhoneNumberDesc(
        national_number_pattern=u'751\d{7}',
        possible_number_pattern=u'\d{10}',
        example_number=u'7511234567'),
    national_prefix=u'8',
    national_prefix_for_parsing=u'8')
Exemple #24
0
"""Auto-generated file, do not edit by hand. MX metadata"""
from phonenumbers import NumberFormat, PhoneNumberDesc, PhoneMetadata

PHONE_METADATA_MX = PhoneMetadata(id='MX', country_code=52, international_prefix='0[09]',
    general_desc=PhoneNumberDesc(national_number_pattern=u'[1-9]\d{9,10}', possible_number_pattern=u'\d{7,11}'),
    fixed_line=PhoneNumberDesc(national_number_pattern=u'(?:33|55|81)\d{8}|(?:2(?:2[2-9]|3[1-35-8]|4[13-9]|7[1-689]|8[1-58]|9[467])|3(?:1[1-79]|[2458][1-9]|7[1-8]|9[1-5])|4(?:1[1-57-9]|[24-6][1-9]|[37][1-8]|8[1-35-9]|9[2-689])|5(?:88|9[1-79])|6(?:1[2-68]|[234][1-9]|5[1-3689]|6[12457-9]|7[1-7]|8[67]|9[4-8])|7(?:[13467][1-9]|2[1-8]|5[13-9]|8[1-69]|9[17])|8(?:2[13-689]|3[1-6]|4[124-6]|6[1246-9]|7[1-378]|9[12479])|9(?:1[346-9]|2[1-4]|3[2-46-8]|5[1348]|[69][1-9]|7[12]|8[1-8]))\d{7}', possible_number_pattern=u'\d{7,10}', example_number=u'2221234567'),
    mobile=PhoneNumberDesc(national_number_pattern=u'1(?:(?:33|55|81)\d{8}|(?:2(?:2[2-9]|3[1-35-8]|4[13-9]|7[1-689]|8[1-58]|9[467])|3(?:1[1-79]|[2458][1-9]|7[1-8]|9[1-5])|4(?:1[1-57-9]|[24-6][1-9]|[37][1-8]|8[1-35-9]|9[2-689])|5(?:88|9[1-79])|6(?:1[2-68]|[2-4][1-9]|5[1-3689]|6[12457-9]|7[1-7]|8[67]|9[4-8])|7(?:[13467][1-9]|2[1-8]|5[13-9]|8[1-69]|9[17])|8(?:2[13-689]|3[1-6]|4[124-6]|6[1246-9]|7[1-378]|9[12479])|9(?:1[346-9]|2[1-4]|3[2-46-8]|5[1348]|[69][1-9]|7[12]|8[1-8]))\d{7})', possible_number_pattern=u'\d{11}', example_number=u'12221234567'),
    toll_free=PhoneNumberDesc(national_number_pattern=u'800\d{7}', possible_number_pattern=u'\d{10}', example_number=u'8001234567'),
    premium_rate=PhoneNumberDesc(national_number_pattern=u'900\d{7}', possible_number_pattern=u'\d{10}', example_number=u'9001234567'),
    shared_cost=PhoneNumberDesc(national_number_pattern=u'NA', possible_number_pattern=u'NA'),
    personal_number=PhoneNumberDesc(national_number_pattern=u'NA', possible_number_pattern=u'NA'),
    voip=PhoneNumberDesc(national_number_pattern=u'NA', possible_number_pattern=u'NA'),
    pager=PhoneNumberDesc(national_number_pattern=u'NA', possible_number_pattern=u'NA'),
    uan=PhoneNumberDesc(national_number_pattern=u'NA', possible_number_pattern=u'NA'),
    no_international_dialling=PhoneNumberDesc(national_number_pattern=u'NA', possible_number_pattern=u'NA'),
    national_prefix=u'01',
    national_prefix_for_parsing=u'0[12]|04[45](\d{10})',
    national_prefix_transform_rule=u'1\\1',
    number_format=[NumberFormat(pattern='([358]\d)(\d{4})(\d{4})', format=u'\\1 \\2 \\3', leading_digits_pattern=['33|55|81'], national_prefix_formatting_rule=u'01 \\1'),
        NumberFormat(pattern='(\d{3})(\d{3})(\d{4})', format=u'\\1 \\2 \\3', leading_digits_pattern=['[2467]|3[12457-9]|5[89]|8[02-9]|9[0-35-9]'], national_prefix_formatting_rule=u'01 \\1'),
        NumberFormat(pattern='1([358]\d)(\d{4})(\d{4})', format=u'045 \\1 \\2 \\3', leading_digits_pattern=['1(?:33|55|81)'], national_prefix_formatting_rule=u'\\1'),
        NumberFormat(pattern='1(\d{3})(\d{3})(\d{4})', format=u'045 \\1 \\2 \\3', leading_digits_pattern=['1(?:[2467]|3[12457-9]|5[89]|8[2-9]|9[1-35-9])'], national_prefix_formatting_rule=u'\\1')],
    intl_number_format=[NumberFormat(pattern='([358]\d)(\d{4})(\d{4})', format=u'\\1 \\2 \\3', leading_digits_pattern=['33|55|81'], national_prefix_formatting_rule=u'01 \\1'),
        NumberFormat(pattern='(\d{3})(\d{3})(\d{4})', format=u'\\1 \\2 \\3', leading_digits_pattern=['[2467]|3[12457-9]|5[89]|8[02-9]|9[0-35-9]'], national_prefix_formatting_rule=u'01 \\1'),
        NumberFormat(pattern='(1)([358]\d)(\d{4})(\d{4})', format=u'\\1 \\2 \\3 \\4', leading_digits_pattern=['1(?:33|55|81)'], national_prefix_formatting_rule=u'01 \\1'),
        NumberFormat(pattern='(1)(\d{3})(\d{3})(\d{4})', format=u'\\1 \\2 \\3 \\4', leading_digits_pattern=['1(?:[2467]|3[12457-9]|5[89]|8[2-9]|9[1-35-9])'], national_prefix_formatting_rule=u'01 \\1')])
from phonenumbers import NumberFormat, PhoneNumberDesc, PhoneMetadata

PHONE_METADATA_AC = PhoneMetadata(
    id='AC',
    country_code=247,
    international_prefix='00',
    general_desc=PhoneNumberDesc(national_number_pattern=u'[2-46]\d{3}',
                                 possible_number_pattern=u'\d{4}'),
    fixed_line=PhoneNumberDesc(
        national_number_pattern=u'(?:3[0-5]|4[4-6]|[26]\d)\d{2}',
        possible_number_pattern=u'\d{4}',
        example_number=u'6889'),
    mobile=PhoneNumberDesc(national_number_pattern=u'NA',
                           possible_number_pattern=u'NA'),
    toll_free=PhoneNumberDesc(national_number_pattern=u'NA',
                              possible_number_pattern=u'NA'),
    premium_rate=PhoneNumberDesc(national_number_pattern=u'NA',
                                 possible_number_pattern=u'NA'),
    shared_cost=PhoneNumberDesc(national_number_pattern=u'NA',
                                possible_number_pattern=u'NA'),
    personal_number=PhoneNumberDesc(national_number_pattern=u'NA',
                                    possible_number_pattern=u'NA'),
    voip=PhoneNumberDesc(national_number_pattern=u'NA',
                         possible_number_pattern=u'NA'),
    pager=PhoneNumberDesc(national_number_pattern=u'NA',
                          possible_number_pattern=u'NA'),
    uan=PhoneNumberDesc(national_number_pattern=u'NA',
                        possible_number_pattern=u'NA'),
    no_international_dialling=PhoneNumberDesc(national_number_pattern=u'NA',
                                              possible_number_pattern=u'NA'))
"""Auto-generated file, do not edit by hand. NI metadata"""
from phonenumbers import NumberFormat, PhoneNumberDesc, PhoneMetadata

PHONE_METADATA_NI = PhoneMetadata(id='NI', country_code=505, international_prefix='00',
    general_desc=PhoneNumberDesc(national_number_pattern=u'[128]\d{7}', possible_number_pattern=u'\d{8}'),
    fixed_line=PhoneNumberDesc(national_number_pattern=u'2\d{7}', possible_number_pattern=u'\d{8}', example_number=u'21234567'),
    mobile=PhoneNumberDesc(national_number_pattern=u'8\d{7}', possible_number_pattern=u'\d{8}', example_number=u'81234567'),
    toll_free=PhoneNumberDesc(national_number_pattern=u'1800\d{4}', possible_number_pattern=u'\d{8}', example_number=u'18001234'),
    premium_rate=PhoneNumberDesc(national_number_pattern=u'NA', possible_number_pattern=u'NA'),
    shared_cost=PhoneNumberDesc(national_number_pattern=u'NA', possible_number_pattern=u'NA'),
    personal_number=PhoneNumberDesc(national_number_pattern=u'NA', possible_number_pattern=u'NA'),
    voip=PhoneNumberDesc(national_number_pattern=u'NA', possible_number_pattern=u'NA'),
    pager=PhoneNumberDesc(national_number_pattern=u'NA', possible_number_pattern=u'NA'),
    uan=PhoneNumberDesc(national_number_pattern=u'NA', possible_number_pattern=u'NA'),
    no_international_dialling=PhoneNumberDesc(national_number_pattern=u'NA', possible_number_pattern=u'NA'),
    number_format=[NumberFormat(pattern='(\d{4})(\d{4})', format=u'\\1 \\2')])
PHONE_METADATA_MZ = PhoneMetadata(
    id='MZ',
    country_code=258,
    international_prefix='00',
    general_desc=PhoneNumberDesc(national_number_pattern=u'[28]\d{7,8}',
                                 possible_number_pattern=u'\d{8,9}'),
    fixed_line=PhoneNumberDesc(
        national_number_pattern=u'2(?:[1346]\d|5[0-2]|[78][12]|93)\d{5}',
        possible_number_pattern=u'\d{8}',
        example_number=u'21123456'),
    mobile=PhoneNumberDesc(national_number_pattern=u'8[24]\d{7}',
                           possible_number_pattern=u'\d{9}',
                           example_number=u'821234567'),
    toll_free=PhoneNumberDesc(national_number_pattern=u'800\d{6}',
                              possible_number_pattern=u'\d{9}',
                              example_number=u'800123456'),
    premium_rate=PhoneNumberDesc(national_number_pattern=u'NA',
                                 possible_number_pattern=u'NA'),
    shared_cost=PhoneNumberDesc(national_number_pattern=u'NA',
                                possible_number_pattern=u'NA'),
    personal_number=PhoneNumberDesc(national_number_pattern=u'NA',
                                    possible_number_pattern=u'NA'),
    voip=PhoneNumberDesc(national_number_pattern=u'NA',
                         possible_number_pattern=u'NA'),
    pager=PhoneNumberDesc(national_number_pattern=u'NA',
                          possible_number_pattern=u'NA'),
    uan=PhoneNumberDesc(national_number_pattern=u'NA',
                        possible_number_pattern=u'NA'),
    no_international_dialling=PhoneNumberDesc(national_number_pattern=u'NA',
                                              possible_number_pattern=u'NA'),
    number_format=[
        NumberFormat(pattern='([28]\d)(\d{3})(\d{3,4})',
                     format=u'\\1 \\2 \\3',
                     leading_digits_pattern=['2|8[24]']),
        NumberFormat(pattern='(80\d)(\d{3})(\d{3})',
                     format=u'\\1 \\2 \\3',
                     leading_digits_pattern=['80'])
    ])
"""Auto-generated file, do not edit by hand. TO metadata"""
from phonenumbers import NumberFormat, PhoneNumberDesc, PhoneMetadata

PHONE_METADATA_TO = PhoneMetadata(
    id='TO',
    country_code=676,
    international_prefix='00',
    general_desc=PhoneNumberDesc(),
    fixed_line=PhoneNumberDesc(),
    mobile=PhoneNumberDesc(),
    toll_free=PhoneNumberDesc(national_number_pattern=u'NA',
                              possible_number_pattern=u'NA'),
    premium_rate=PhoneNumberDesc(national_number_pattern=u'NA',
                                 possible_number_pattern=u'NA'),
    shared_cost=PhoneNumberDesc(national_number_pattern=u'NA',
                                possible_number_pattern=u'NA'),
    personal_number=PhoneNumberDesc(national_number_pattern=u'NA',
                                    possible_number_pattern=u'NA'),
    voip=PhoneNumberDesc(national_number_pattern=u'NA',
                         possible_number_pattern=u'NA'),
    pager=PhoneNumberDesc(national_number_pattern=u'NA',
                          possible_number_pattern=u'NA'),
    uan=PhoneNumberDesc(national_number_pattern=u'NA',
                        possible_number_pattern=u'NA'),
    no_international_dialling=PhoneNumberDesc(national_number_pattern=u'NA',
                                              possible_number_pattern=u'NA'))
Exemple #29
0
"""Auto-generated file, do not edit by hand. KH metadata"""
from phonenumbers import NumberFormat, PhoneNumberDesc, PhoneMetadata

PHONE_METADATA_KH = PhoneMetadata(id='KH', country_code=855, international_prefix='00[178]',
    general_desc=PhoneNumberDesc(national_number_pattern=u'[1-9]\d{7,9}', possible_number_pattern=u'\d{6,10}'),
    fixed_line=PhoneNumberDesc(national_number_pattern=u'(?:2[3-6]|3[2-6]|4[2-4]|[5-7][2-5])[2-47-9]\d{5}', possible_number_pattern=u'\d{6,8}', example_number=u'23456789'),
    mobile=PhoneNumberDesc(national_number_pattern=u'(?:(?:1[0-35-9]|9[1-49])[1-9]|8(?:0[89]|5[2-689]))\d{5}', possible_number_pattern=u'\d{8}', example_number=u'91234567'),
    toll_free=PhoneNumberDesc(national_number_pattern=u'1800(?:1\d|2[09])\d{4}', possible_number_pattern=u'\d{10}', example_number=u'1800123456'),
    premium_rate=PhoneNumberDesc(national_number_pattern=u'1900(?:1\d|2[09])\d{4}', possible_number_pattern=u'\d{10}', example_number=u'1900123456'),
    shared_cost=PhoneNumberDesc(national_number_pattern=u'NA', possible_number_pattern=u'NA'),
    personal_number=PhoneNumberDesc(national_number_pattern=u'NA', possible_number_pattern=u'NA'),
    voip=PhoneNumberDesc(national_number_pattern=u'NA', possible_number_pattern=u'NA'),
    pager=PhoneNumberDesc(national_number_pattern=u'NA', possible_number_pattern=u'NA'),
    uan=PhoneNumberDesc(national_number_pattern=u'NA', possible_number_pattern=u'NA'),
    no_international_dialling=PhoneNumberDesc(national_number_pattern=u'NA', possible_number_pattern=u'NA'),
    national_prefix=u'0',
    national_prefix_for_parsing=u'0',
    number_format=[NumberFormat(pattern='(\d{2})(\d{3})(\d{3})', format=u'\\1 \\2 \\3', leading_digits_pattern=['1\d[1-9]|[2-9]'], national_prefix_formatting_rule=u'0\\1'),
        NumberFormat(pattern='(1[89]00)(\d{3})(\d{3})', format=u'\\1 \\2 \\3', leading_digits_pattern=['1[89]0'])])
Exemple #30
0
PHONE_METADATA_BB = PhoneMetadata(
    id='BB',
    country_code=1,
    international_prefix='011',
    general_desc=PhoneNumberDesc(national_number_pattern='[2589]\\d{9}',
                                 possible_number_pattern='\\d{7}(?:\\d{3})?'),
    fixed_line=PhoneNumberDesc(national_number_pattern='246[2-9]\\d{6}',
                               possible_number_pattern='\\d{7}(?:\\d{3})?',
                               example_number='2462345678'),
    mobile=PhoneNumberDesc(
        national_number_pattern='246(?:(?:2[346]|45|82)\\d|25[0-4])\\d{4}',
        possible_number_pattern='\\d{10}',
        example_number='2462501234'),
    toll_free=PhoneNumberDesc(
        national_number_pattern='8(?:00|55|66|77|88)[2-9]\\d{6}',
        possible_number_pattern='\\d{10}',
        example_number='8002123456'),
    premium_rate=PhoneNumberDesc(national_number_pattern='900[2-9]\\d{6}',
                                 possible_number_pattern='\\d{10}',
                                 example_number='9002123456'),
    shared_cost=PhoneNumberDesc(national_number_pattern='NA',
                                possible_number_pattern='NA'),
    personal_number=PhoneNumberDesc(
        national_number_pattern='5(?:00|33|44)[2-9]\\d{6}',
        possible_number_pattern='\\d{10}',
        example_number='5002345678'),
    voip=PhoneNumberDesc(national_number_pattern='NA',
                         possible_number_pattern='NA'),
    pager=PhoneNumberDesc(national_number_pattern='NA',
                          possible_number_pattern='NA'),
    uan=PhoneNumberDesc(national_number_pattern='NA',
                        possible_number_pattern='NA'),
    no_international_dialling=PhoneNumberDesc(national_number_pattern='NA',
                                              possible_number_pattern='NA'),
    national_prefix=u'1',
    national_prefix_for_parsing=u'1',
    leading_digits='246')