Add project files.

This commit is contained in:
eviled 2025-07-13 22:10:11 -04:00
commit eeda32a9b2
1735 changed files with 700598 additions and 0 deletions

View file

@ -0,0 +1,226 @@
"""Python phone number parsing and formatting library
Examples of use:
>>> import phonenumbers
>>> from phonenumbers.util import prnt # equivalent to Py3k print()
>>> x = phonenumbers.parse("+442083661177", None)
>>> prnt(x)
Country Code: 44 National Number: 2083661177
>>> type(x)
<class 'phonenumbers.phonenumber.PhoneNumber'>
>>> str(phonenumbers.format_number(x, phonenumbers.PhoneNumberFormat.NATIONAL))
'020 8366 1177'
>>> str(phonenumbers.format_number(x, phonenumbers.PhoneNumberFormat.INTERNATIONAL))
'+44 20 8366 1177'
>>> str(phonenumbers.format_number(x, phonenumbers.PhoneNumberFormat.E164))
'+442083661177'
>>> y = phonenumbers.parse("020 8366 1177", "GB")
>>> prnt(y)
Country Code: 44 National Number: 2083661177
>>> x == y
True
>>>
>>> formatter = phonenumbers.AsYouTypeFormatter("US")
>>> prnt(formatter.input_digit("6"))
6
>>> prnt(formatter.input_digit("5"))
65
>>> prnt(formatter.input_digit("0"))
650
>>> prnt(formatter.input_digit("2"))
650-2
>>> prnt(formatter.input_digit("5"))
650-25
>>> prnt(formatter.input_digit("3"))
650-253
>>> prnt(formatter.input_digit("2"))
650-2532
>>> prnt(formatter.input_digit("2"))
(650) 253-22
>>> prnt(formatter.input_digit("2"))
(650) 253-222
>>> prnt(formatter.input_digit("2"))
(650) 253-2222
>>>
>>> text = "Call me at 510-748-8230 if it's before 9:30, or on 703-4800500 after 10am."
>>> for match in phonenumbers.PhoneNumberMatcher(text, "US"):
... prnt(match)
...
PhoneNumberMatch [11,23) 510-748-8230
PhoneNumberMatch [51,62) 703-4800500
>>> for match in phonenumbers.PhoneNumberMatcher(text, "US"):
... prnt(phonenumbers.format_number(match.number, phonenumbers.PhoneNumberFormat.E164))
...
+15107488230
+17034800500
>>>
"""
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# 'Some people, when confronted with a problem, think "I know,
# I'll use regular expressions." Now they have two problems.'
# -- jwz 1997-08-12
# Data class definitions
from .phonenumber import PhoneNumber, CountryCodeSource, FrozenPhoneNumber
from .phonemetadata import REGION_CODE_FOR_NON_GEO_ENTITY, NumberFormat, PhoneNumberDesc, PhoneMetadata
# Functionality
from .asyoutypeformatter import AsYouTypeFormatter
from .phonenumberutil import (COUNTRY_CODE_TO_REGION_CODE, SUPPORTED_REGIONS,
UNKNOWN_REGION, COUNTRY_CODES_FOR_NON_GEO_REGIONS,
NON_DIGITS_PATTERN,
MatchType, NumberParseException, PhoneNumberFormat,
PhoneNumberType, ValidationResult,
can_be_internationally_dialled,
convert_alpha_characters_in_number,
country_code_for_region,
country_code_for_valid_region,
country_mobile_token,
example_number,
example_number_for_type,
example_number_for_non_geo_entity,
format_by_pattern,
format_in_original_format,
format_national_number_with_carrier_code,
format_national_number_with_preferred_carrier_code,
format_number_for_mobile_dialing,
format_number,
format_out_of_country_calling_number,
format_out_of_country_keeping_alpha_chars,
invalid_example_number,
is_alpha_number,
is_nanpa_country,
is_number_match,
is_number_geographical,
is_number_type_geographical,
is_possible_number,
is_possible_number_for_type,
is_possible_number_for_type_with_reason,
is_possible_number_string,
is_possible_number_with_reason,
is_valid_number,
is_valid_number_for_region,
length_of_geographical_area_code,
length_of_national_destination_code,
national_significant_number,
ndd_prefix_for_region,
normalize_digits_only,
normalize_diallable_chars_only,
number_type,
parse,
region_code_for_country_code,
region_codes_for_country_code,
region_code_for_number,
supported_calling_codes,
supported_types_for_region,
supported_types_for_non_geo_entity,
truncate_too_long_number,
is_mobile_number_portable_region,)
from .shortnumberinfo import (SUPPORTED_SHORT_REGIONS,
ShortNumberCost,
is_possible_short_number_for_region,
is_possible_short_number,
is_valid_short_number_for_region,
is_valid_short_number,
expected_cost_for_region,
expected_cost,
connects_to_emergency_number,
is_emergency_number,
is_carrier_specific,
is_carrier_specific_for_region,
is_sms_service_for_region)
from .phonenumbermatcher import PhoneNumberMatch, PhoneNumberMatcher, Leniency
# Version number is taken from the upstream libphonenumber version
# together with an indication of the version of the Python-specific code.
__version__ = "8.13.28"
__all__ = ['PhoneNumber', 'CountryCodeSource', 'FrozenPhoneNumber',
'REGION_CODE_FOR_NON_GEO_ENTITY', 'NumberFormat', 'PhoneNumberDesc', 'PhoneMetadata',
'AsYouTypeFormatter',
# items from phonenumberutil.py
'COUNTRY_CODE_TO_REGION_CODE', 'SUPPORTED_REGIONS',
'UNKNOWN_REGION', 'COUNTRY_CODES_FOR_NON_GEO_REGIONS',
'NON_DIGITS_PATTERN',
'MatchType', 'NumberParseException', 'PhoneNumberFormat',
'PhoneNumberType', 'ValidationResult',
'can_be_internationally_dialled',
'convert_alpha_characters_in_number',
'country_code_for_region',
'country_code_for_valid_region',
'country_mobile_token',
'example_number',
'example_number_for_type',
'example_number_for_non_geo_entity',
'format_by_pattern',
'format_in_original_format',
'format_national_number_with_carrier_code',
'format_national_number_with_preferred_carrier_code',
'format_number_for_mobile_dialing',
'format_number',
'format_out_of_country_calling_number',
'format_out_of_country_keeping_alpha_chars',
'invalid_example_number',
'is_alpha_number',
'is_nanpa_country',
'is_number_geographical',
'is_number_type_geographical',
'is_number_match',
'is_possible_number',
'is_possible_number_for_type',
'is_possible_number_for_type_with_reason',
'is_possible_number_string',
'is_possible_number_with_reason',
'is_valid_number',
'is_valid_number_for_region',
'length_of_geographical_area_code',
'length_of_national_destination_code',
'national_significant_number',
'ndd_prefix_for_region',
'normalize_digits_only',
'normalize_diallable_chars_only',
'number_type',
'parse',
'region_code_for_country_code',
'region_codes_for_country_code',
'region_code_for_number',
'supported_calling_codes',
'supported_types_for_region',
'supported_types_for_non_geo_entity',
'truncate_too_long_number',
'is_mobile_number_portable_region',
# end of items from phonenumberutil.py
# items from shortnumberinfo.py
'SUPPORTED_SHORT_REGIONS',
'ShortNumberCost',
'is_possible_short_number_for_region',
'is_possible_short_number',
'is_valid_short_number_for_region',
'is_valid_short_number',
'expected_cost_for_region',
'expected_cost',
'connects_to_emergency_number',
'is_emergency_number',
'is_carrier_specific',
'is_carrier_specific_for_region',
'is_sms_service_for_region',
# end of items from shortnumberinfo.py
'PhoneNumberMatch', 'PhoneNumberMatcher', 'Leniency',
]
if __name__ == '__main__': # pragma no cover
import doctest
doctest.testmod()

View file

@ -0,0 +1,82 @@
from .asyoutypeformatter import AsYouTypeFormatter as AsYouTypeFormatter
from .phonemetadata import NumberFormat as NumberFormat
from .phonemetadata import PhoneMetadata as PhoneMetadata
from .phonemetadata import PhoneNumberDesc as PhoneNumberDesc
from .phonemetadata import REGION_CODE_FOR_NON_GEO_ENTITY as REGION_CODE_FOR_NON_GEO_ENTITY
from .phonenumber import CountryCodeSource as CountryCodeSource
from .phonenumber import FrozenPhoneNumber as FrozenPhoneNumber
from .phonenumber import PhoneNumber as PhoneNumber
from .phonenumbermatcher import Leniency as Leniency
from .phonenumbermatcher import PhoneNumberMatch as PhoneNumberMatch
from .phonenumbermatcher import PhoneNumberMatcher as PhoneNumberMatcher
from .phonenumberutil import can_be_internationally_dialled as can_be_internationally_dialled
from .phonenumberutil import convert_alpha_characters_in_number as convert_alpha_characters_in_number
from .phonenumberutil import country_code_for_region as country_code_for_region
from .phonenumberutil import country_code_for_valid_region as country_code_for_valid_region
from .phonenumberutil import COUNTRY_CODE_TO_REGION_CODE as COUNTRY_CODE_TO_REGION_CODE
from .phonenumberutil import COUNTRY_CODES_FOR_NON_GEO_REGIONS as COUNTRY_CODES_FOR_NON_GEO_REGIONS
from .phonenumberutil import country_mobile_token as country_mobile_token
from .phonenumberutil import example_number as example_number
from .phonenumberutil import example_number_for_non_geo_entity as example_number_for_non_geo_entity
from .phonenumberutil import example_number_for_type as example_number_for_type
from .phonenumberutil import format_by_pattern as format_by_pattern
from .phonenumberutil import format_in_original_format as format_in_original_format
from .phonenumberutil import format_national_number_with_carrier_code as format_national_number_with_carrier_code
from .phonenumberutil import format_national_number_with_preferred_carrier_code as format_national_number_with_preferred_carrier_code
from .phonenumberutil import format_number as format_number
from .phonenumberutil import format_number_for_mobile_dialing as format_number_for_mobile_dialing
from .phonenumberutil import format_out_of_country_calling_number as format_out_of_country_calling_number
from .phonenumberutil import format_out_of_country_keeping_alpha_chars as format_out_of_country_keeping_alpha_chars
from .phonenumberutil import invalid_example_number as invalid_example_number
from .phonenumberutil import is_alpha_number as is_alpha_number
from .phonenumberutil import is_mobile_number_portable_region as is_mobile_number_portable_region
from .phonenumberutil import is_nanpa_country as is_nanpa_country
from .phonenumberutil import is_number_geographical as is_number_geographical
from .phonenumberutil import is_number_match as is_number_match
from .phonenumberutil import is_number_type_geographical as is_number_type_geographical
from .phonenumberutil import is_possible_number as is_possible_number
from .phonenumberutil import is_possible_number_for_type as is_possible_number_for_type
from .phonenumberutil import is_possible_number_for_type_with_reason as is_possible_number_for_type_with_reason
from .phonenumberutil import is_possible_number_string as is_possible_number_string
from .phonenumberutil import is_possible_number_with_reason as is_possible_number_with_reason
from .phonenumberutil import is_valid_number as is_valid_number
from .phonenumberutil import is_valid_number_for_region as is_valid_number_for_region
from .phonenumberutil import length_of_geographical_area_code as length_of_geographical_area_code
from .phonenumberutil import length_of_national_destination_code as length_of_national_destination_code
from .phonenumberutil import MatchType as MatchType
from .phonenumberutil import national_significant_number as national_significant_number
from .phonenumberutil import ndd_prefix_for_region as ndd_prefix_for_region
from .phonenumberutil import NON_DIGITS_PATTERN as NON_DIGITS_PATTERN
from .phonenumberutil import normalize_diallable_chars_only as normalize_diallable_chars_only
from .phonenumberutil import normalize_digits_only as normalize_digits_only
from .phonenumberutil import number_type as number_type
from .phonenumberutil import NumberParseException as NumberParseException
from .phonenumberutil import parse as parse
from .phonenumberutil import PhoneNumberFormat as PhoneNumberFormat
from .phonenumberutil import PhoneNumberType as PhoneNumberType
from .phonenumberutil import region_code_for_country_code as region_code_for_country_code
from .phonenumberutil import region_code_for_number as region_code_for_number
from .phonenumberutil import region_codes_for_country_code as region_codes_for_country_code
from .phonenumberutil import supported_calling_codes as supported_calling_codes
from .phonenumberutil import SUPPORTED_REGIONS as SUPPORTED_REGIONS
from .phonenumberutil import supported_types_for_non_geo_entity as supported_types_for_non_geo_entity
from .phonenumberutil import supported_types_for_region as supported_types_for_region
from .phonenumberutil import truncate_too_long_number as truncate_too_long_number
from .phonenumberutil import UNKNOWN_REGION as UNKNOWN_REGION
from .phonenumberutil import ValidationResult as ValidationResult
from .shortnumberinfo import connects_to_emergency_number as connects_to_emergency_number
from .shortnumberinfo import expected_cost as expected_cost
from .shortnumberinfo import expected_cost_for_region as expected_cost_for_region
from .shortnumberinfo import is_carrier_specific as is_carrier_specific
from .shortnumberinfo import is_carrier_specific_for_region as is_carrier_specific_for_region
from .shortnumberinfo import is_emergency_number as is_emergency_number
from .shortnumberinfo import is_possible_short_number as is_possible_short_number
from .shortnumberinfo import is_possible_short_number_for_region as is_possible_short_number_for_region
from .shortnumberinfo import is_sms_service_for_region as is_sms_service_for_region
from .shortnumberinfo import is_valid_short_number as is_valid_short_number
from .shortnumberinfo import is_valid_short_number_for_region as is_valid_short_number_for_region
from .shortnumberinfo import ShortNumberCost as ShortNumberCost
from .shortnumberinfo import SUPPORTED_SHORT_REGIONS as SUPPORTED_SHORT_REGIONS
__version__: str
__all__: list[str]

View file

@ -0,0 +1,609 @@
"""A formatter which formats phone numbers as they are entered.
An AsYouTypeFormatter can be created by invoking
AsYouTypeFormatter(region_code). After that digits can be added by invoking
input_digit() on the formatter instance, and the partially formatted phone
number will be returned each time a digit is added. clear() should be invoked
before a new number needs to be formatted.
See the unit tests for more details on how the formatter is to be used.
"""
# Based on original Java code:
# java/src/com/google/i18n/phonenumbers/AsYouTypeFormatter.java
# Copyright (C) 2009-2011 The Libphonenumber Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import re
from .util import u, unicod, U_EMPTY_STRING, U_SPACE
from .unicode_util import digit as unicode_digit
from .re_util import fullmatch
from .phonemetadata import PhoneMetadata, REGION_CODE_FOR_NON_GEO_ENTITY
from .phonenumberutil import _VALID_PUNCTUATION
from .phonenumberutil import _PLUS_SIGN, _PLUS_CHARS_PATTERN
from .phonenumberutil import _extract_country_code, region_code_for_country_code
from .phonenumberutil import country_code_for_region, normalize_diallable_chars_only
from .phonenumberutil import _formatting_rule_has_first_group_only
# Character used when appropriate to separate a prefix, such as a long NDD or
# a country calling code, from the national number.
_SEPARATOR_BEFORE_NATIONAL_NUMBER = U_SPACE
_EMPTY_METADATA = PhoneMetadata(id=unicod(""),
international_prefix=unicod("NA"),
register=False)
# A set of characters that, if found in a national prefix formatting rules, are an indicator to
# us that we should separate the national prefix from the number when formatting.
_NATIONAL_PREFIX_SEPARATORS_PATTERN = re.compile("[- ]")
# A pattern that is used to determine if a number_format under
# available_formats is eligible to be used by the AYTF. It is eligible when
# the format element under number_format contains groups of the dollar sign
# followed by a single digit, separated by valid phone number
# punctuation. This prevents invalid punctuation (such as the star sign in
# Israeli star numbers) getting into the output of the AYTF. We require that
# the first group is present in the output pattern to ensure no data is lost
# while formatting; when we format as you type, this should always be the case.
_ELIGIBLE_FORMAT_PATTERN = re.compile(unicod("[") + _VALID_PUNCTUATION + unicod("]*") +
unicod("\\\\1") + unicod("[") + _VALID_PUNCTUATION + unicod("]*") +
unicod("(\\\\\\d") + unicod("[") + _VALID_PUNCTUATION + unicod("]*)*"))
# This is the minimum length of national number accrued that is required to
# trigger the formatter. The first element of the leading_digits_pattern of each
# number_format contains a regular expression that matches up to this number of
# digits.
_MIN_LEADING_DIGITS_LENGTH = 3
# The digits that have not been entered yet will be represented by a \u2008,
# the punctuation space.
_DIGIT_PLACEHOLDER = u("\u2008")
_DIGIT_PATTERN = re.compile(_DIGIT_PLACEHOLDER)
def _get_metadata_for_region(region_code):
"""The metadata needed by this class is the same for all regions
sharing the same country calling code. Therefore, we return the
metadata for "main" region for this country calling code."""
country_calling_code = country_code_for_region(region_code)
main_country = region_code_for_country_code(country_calling_code)
# Set to a default instance of the metadata. This allows us to
# function with an incorrect region code, even if formatting only
# works for numbers specified with "+".
return PhoneMetadata.metadata_for_region(main_country, _EMPTY_METADATA)
class AsYouTypeFormatter(object):
def __init__(self, region_code):
"""Gets an AsYouTypeFormatter for the specific region.
Arguments:
region_code -- The region where the phone number is being entered
Return an AsYouTypeFormatter object, which could be used to format
phone numbers in the specific region "as you type"
"""
self._clear()
self._default_country = region_code.upper()
self._current_metadata = _get_metadata_for_region(self._default_country)
self._default_metadata = self._current_metadata
def _maybe_create_new_template(self):
"""Returns True if a new template is created as opposed to reusing the existing template.
When there are multiple available formats, the formatter uses the
first format where a formatting template could be created.
"""
ii = 0
while ii < len(self._possible_formats):
number_format = self._possible_formats[ii]
pattern = number_format.pattern
if self._current_formatting_pattern == pattern:
return False
if self._create_formatting_template(number_format):
self._current_formatting_pattern = pattern
if number_format.national_prefix_formatting_rule is None:
self._should_add_space_after_national_prefix = False
else:
self._should_add_space_after_national_prefix = bool(_NATIONAL_PREFIX_SEPARATORS_PATTERN.search(number_format.national_prefix_formatting_rule))
# With a new formatting template, the matched position using
# the old template needs to be reset.
self._last_match_position = 0
return True
else:
# Remove the current number format from _possible_formats
del self._possible_formats[ii]
ii -= 1
ii += 1
self._able_to_format = False
return False
def _get_available_formats(self, leading_digits):
# First decide whether we should use international or national number rules.
is_international_number = (self._is_complete_number and len(self._extracted_national_prefix) == 0)
if (is_international_number and
len(self._current_metadata.intl_number_format) > 0):
format_list = self._current_metadata.intl_number_format
else:
format_list = self._current_metadata.number_format
for this_format in format_list:
# Discard a few formats that we know are not relevant based on the presence of the national
# prefix.
if (len(self._extracted_national_prefix) > 0 and
_formatting_rule_has_first_group_only(this_format.national_prefix_formatting_rule) and
not this_format.national_prefix_optional_when_formatting and
not (this_format.domestic_carrier_code_formatting_rule is not None)):
# If it is a national number that had a national prefix, any rules that aren't valid with a
# national prefix should be excluded. A rule that has a carrier-code formatting rule is
# kept since the national prefix might actually be an extracted carrier code - we don't
# distinguish between these when extracting it in the AYTF.
continue
elif (len(self._extracted_national_prefix) == 0 and
not self._is_complete_number and
not _formatting_rule_has_first_group_only(this_format.national_prefix_formatting_rule) and
not this_format.national_prefix_optional_when_formatting):
# This number was entered without a national prefix, and this formatting rule requires one,
# so we discard it.
continue
if fullmatch(_ELIGIBLE_FORMAT_PATTERN, this_format.format):
self._possible_formats.append(this_format)
self._narrow_down_possible_formats(leading_digits)
def _narrow_down_possible_formats(self, leading_digits):
index_of_leading_digits_pattern = len(leading_digits) - _MIN_LEADING_DIGITS_LENGTH
ii = 0
while ii < len(self._possible_formats):
num_format = self._possible_formats[ii]
ii += 1
if len(num_format.leading_digits_pattern) == 0:
# Keep everything that isn't restricted by leading digits.
continue
last_leading_digits_pattern = min(index_of_leading_digits_pattern,
len(num_format.leading_digits_pattern) - 1)
leading_digits_pattern = re.compile(num_format.leading_digits_pattern[last_leading_digits_pattern])
m = leading_digits_pattern.match(leading_digits)
if not m:
# remove the element we've just examined, now at (ii-1)
ii -= 1
self._possible_formats.pop(ii)
def _create_formatting_template(self, num_format):
number_pattern = num_format.pattern
self.formatting_template = U_EMPTY_STRING
temp_template = self._get_formatting_template(number_pattern, num_format.format)
if len(temp_template) > 0:
self._formatting_template = temp_template
return True
return False
def _get_formatting_template(self, number_pattern, number_format):
"""Gets a formatting template which can be used to efficiently
format a partial number where digits are added one by one."""
# Create a phone number consisting only of the digit 9 that matches the
# number_pattern by applying the pattern to the longest_phone_number string.
longest_phone_number = unicod("999999999999999")
number_re = re.compile(number_pattern)
m = number_re.search(longest_phone_number) # this will always succeed
a_phone_number = m.group(0)
# No formatting template can be created if the number of digits
# entered so far is longer than the maximum the current formatting
# rule can accommodate.
if len(a_phone_number) < len(self._national_number):
return U_EMPTY_STRING
# Formats the number according to number_format
template = re.sub(number_pattern, number_format, a_phone_number)
# Replaces each digit with character _DIGIT_PLACEHOLDER
template = re.sub("9", _DIGIT_PLACEHOLDER, template)
return template
def _clear(self):
"""Clears the internal state of the formatter, so it can be reused."""
self._current_output = U_EMPTY_STRING
self._accrued_input = U_EMPTY_STRING
self._accrued_input_without_formatting = U_EMPTY_STRING
self._formatting_template = U_EMPTY_STRING
self._last_match_position = 0
# The pattern from number_format that is currently used to create
# formatting_template.
self._current_formatting_pattern = U_EMPTY_STRING
# This contains anything that has been entered so far preceding the
# national significant number, and it is formatted (e.g. with space
# inserted). For example, this can contain IDD, country code, and/or
# NDD, etc.
self._prefix_before_national_number = U_EMPTY_STRING
self._should_add_space_after_national_prefix = False
# This contains the national prefix that has been extracted. It
# contains only digits without formatting.
self._extracted_national_prefix = U_EMPTY_STRING
self._national_number = U_EMPTY_STRING
# This indicates whether AsYouTypeFormatter is currently doing the
# formatting.
self._able_to_format = True
# Set to true when users enter their own
# formatting. AsYouTypeFormatter will do no formatting at all when
# this is set to True.
self._input_has_formatting = False
# The position of a digit upon which input_digit(remember_position=True) is
# most recently invoked, as found in accrued_input_without_formatting.
self._position_to_remember = 0
# The position of a digit upon which input_digit(remember_position=True) is
# most recently invoked, as found in the original sequence of
# characters the user entered.
self._original_position = 0
# This is set to true when we know the user is entering a full
# national significant number, since we have either detected a
# national prefix or an international dialing prefix. When this is
# true, we will no longer use local number formatting patterns.
self._is_complete_number = False
self._is_expecting_country_calling_code = False
self._possible_formats = []
def clear(self):
"""Clears the internal state of the formatter, so it can be reused."""
self._clear()
if self._current_metadata != self._default_metadata:
self._current_metadata = _get_metadata_for_region(self._default_country)
def input_digit(self, next_char, remember_position=False):
"""Formats a phone number on-the-fly as each digit is entered.
If remember_position is set, remembers the position where next_char is
inserted, so that it can be retrieved later by using
get_remembered_position. The remembered position will be automatically
adjusted if additional formatting characters are later
inserted/removed in front of next_char.
Arguments:
next_char -- The most recently entered digit of a phone
number. Formatting characters are allowed, but as soon as they
are encountered this method formats the number as entered and
not "as you type" anymore. Full width digits and Arabic-indic
digits are allowed, and will be shown as they are.
remember_position -- Whether to track the position where next_char is
inserted.
Returns the partially formatted phone number.
"""
self._accrued_input += next_char
if remember_position:
self._original_position = len(self._accrued_input)
# We do formatting on-the-fly only when each character entered is
# either a digit, or a plus sign (accepted at the start of the number
# only).
if not self._is_digit_or_leading_plus_sign(next_char):
self._able_to_format = False
self._input_has_formatting = True
else:
next_char = self._normalize_and_accrue_digits_and_plus_sign(next_char, remember_position)
if not self._able_to_format:
# When we are unable to format because of reasons other than that
# formatting chars have been entered, it can be due to really long
# IDDs or NDDs. If that is the case, we might be able to do
# formatting again after extracting them.
if self._input_has_formatting:
self._current_output = self._accrued_input
return self._current_output
elif self._attempt_to_extract_idd():
if self._attempt_to_extract_ccc():
self._current_output = self._attempt_to_choose_pattern_with_prefix_extracted()
return self._current_output
elif self._able_to_extract_longer_ndd():
# Add an additional space to separate long NDD and national
# significant number for readability. We don't set
# should_add_space_after_national_prefix to True, since we don't
# want this to change later when we choose formatting
# templates.
self._prefix_before_national_number += _SEPARATOR_BEFORE_NATIONAL_NUMBER
self._current_output = self._attempt_to_choose_pattern_with_prefix_extracted()
return self._current_output
self._current_output = self._accrued_input
return self._current_output
# We start to attempt to format only when at least
# MIN_LEADING_DIGITS_LENGTH digits (the plus sign is counted as a
# digit as well for this purpose) have been entered.
len_input = len(self._accrued_input_without_formatting)
if len_input >= 0 and len_input <= 2:
self._current_output = self._accrued_input
return self._current_output
elif len_input == 3:
if self._attempt_to_extract_idd():
self._is_expecting_country_calling_code = True
else:
# No IDD or plus sign is found, might be entering in national format.
self._extracted_national_prefix = self._remove_national_prefix_from_national_number()
self._current_output = self._attempt_to_choose_formatting_pattern()
return self._current_output
if self._is_expecting_country_calling_code:
if self._attempt_to_extract_ccc():
self._is_expecting_country_calling_code = False
self._current_output = self._prefix_before_national_number + self._national_number
return self._current_output
if len(self._possible_formats) > 0: # The formatting patterns are already chosen.
temp_national_number = self._input_digit_helper(next_char)
# See if the accrued digits can be formatted properly already. If
# not, use the results from input_digit_helper, which does
# formatting based on the formatting pattern chosen.
formatted_number = self._attempt_to_format_accrued_digits()
if len(formatted_number) > 0:
self._current_output = formatted_number
return self._current_output
self._narrow_down_possible_formats(self._national_number)
if self._maybe_create_new_template():
self._current_output = self._input_accrued_national_number()
return self._current_output
if self._able_to_format:
self._current_output = self._append_national_number(temp_national_number)
return self._current_output
else:
self._current_output = self._accrued_input
return self._current_output
else:
self._current_output = self._attempt_to_choose_formatting_pattern()
return self._current_output
def _attempt_to_choose_pattern_with_prefix_extracted(self):
self._able_to_format = True
self._is_expecting_country_calling_code = False
self._possible_formats = []
self._last_match_position = 0
self._formatting_template = U_EMPTY_STRING
self._current_formatting_pattern = U_EMPTY_STRING
return self._attempt_to_choose_formatting_pattern()
# Some national prefixes are a substring of others. If extracting the
# shorter NDD doesn't result in a number we can format, we try to see if
# we can extract a longer version here.
def _able_to_extract_longer_ndd(self):
if len(self._extracted_national_prefix) > 0:
# Put the extracted NDD back to the national number before
# attempting to extract a new NDD.
self._national_number = self._extracted_national_prefix + self._national_number
# Remove the previously extracted NDD from
# prefixBeforeNationalNumber. We cannot simply set it to empty
# string because people sometimes incorrectly enter national
# prefix after the country code, e.g. +44 (0)20-1234-5678.
index_of_previous_ndd = self._prefix_before_national_number.rfind(self._extracted_national_prefix)
self._prefix_before_national_number = self._prefix_before_national_number[:index_of_previous_ndd]
return self._extracted_national_prefix != self._remove_national_prefix_from_national_number()
def _is_digit_or_leading_plus_sign(self, next_char):
return (next_char.isdigit() or
(len(self._accrued_input) == 1 and
fullmatch(_PLUS_CHARS_PATTERN, next_char)))
def _attempt_to_format_accrued_digits(self):
"""Checks to see if there is an exact pattern match for these digits. If so, we should use this
instead of any other formatting template whose leadingDigitsPattern also matches the input.
"""
for number_format in self._possible_formats:
num_re = re.compile(number_format.pattern)
if fullmatch(num_re, self._national_number):
if number_format.national_prefix_formatting_rule is None:
self._should_add_space_after_national_prefix = False
else:
self._should_add_space_after_national_prefix = bool(_NATIONAL_PREFIX_SEPARATORS_PATTERN.search(number_format.national_prefix_formatting_rule))
formatted_number = re.sub(num_re, number_format.format, self._national_number)
# Check that we did not remove nor add any extra digits when we matched
# this formatting pattern. This usually happens after we entered the last
# digit during AYTF. Eg: In case of MX, we swallow mobile token (1) when
# formatted but AYTF should retain all the number entered and not change
# in order to match a format (of same leading digits and length) display
# in that way.
full_output = self._append_national_number(formatted_number)
formatted_number_digits_only = normalize_diallable_chars_only(full_output)
if formatted_number_digits_only == self._accrued_input_without_formatting:
# If it's the same (i.e entered number and format is same), then it's
# safe to return this in formatted number as nothing is lost / added.
return full_output
return U_EMPTY_STRING
def get_remembered_position(self):
"""Returns the current position in the partially formatted phone
number of the character which was previously passed in as the
parameter of input_digit(remember_position=True)."""
if not self._able_to_format:
return self._original_position
accrued_input_index = 0
current_output_index = 0
while (accrued_input_index < self._position_to_remember and
current_output_index < len(self._current_output)):
if (self._accrued_input_without_formatting[accrued_input_index] ==
self._current_output[current_output_index]):
accrued_input_index += 1
current_output_index += 1
return current_output_index
def _append_national_number(self, national_number):
"""Combines the national number with any prefix (IDD/+ and country
code or national prefix) that was collected. A space will be inserted
between them if the current formatting template indicates this to be
suitable.
"""
prefix_before_nn_len = len(self._prefix_before_national_number)
if (self._should_add_space_after_national_prefix and prefix_before_nn_len > 0 and
self._prefix_before_national_number[-1] != _SEPARATOR_BEFORE_NATIONAL_NUMBER):
# We want to add a space after the national prefix if the national
# prefix formatting rule indicates that this would normally be
# done, with the exception of the case where we already appended a
# space because the NDD was surprisingly long.
return self._prefix_before_national_number + _SEPARATOR_BEFORE_NATIONAL_NUMBER + national_number
else:
return self._prefix_before_national_number + national_number
def _attempt_to_choose_formatting_pattern(self):
"""Attempts to set the formatting template and returns a string which
contains the formatted version of the digits entered so far."""
# We start to attempt to format only when at least MIN_LEADING_DIGITS_LENGTH digits of national
# number (excluding national prefix) have been entered.
if len(self._national_number) >= _MIN_LEADING_DIGITS_LENGTH:
self._get_available_formats(self._national_number)
# See if the accrued digits can be formatted properly already.
formatted_number = self._attempt_to_format_accrued_digits()
if len(formatted_number) > 0:
return formatted_number
if self._maybe_create_new_template():
return self._input_accrued_national_number()
else:
return self._accrued_input
else:
return self._append_national_number(self._national_number)
def _input_accrued_national_number(self):
"""Invokes input_digit_helper on each digit of the national number
accrued, and returns a formatted string in the end."""
length_of_national_number = len(self._national_number)
if length_of_national_number > 0:
temp_national_number = U_EMPTY_STRING
for ii in range(length_of_national_number):
temp_national_number = self._input_digit_helper(self._national_number[ii])
if self._able_to_format:
return self._append_national_number(temp_national_number)
else:
return self._accrued_input
else:
return self._prefix_before_national_number
def _is_nanpa_number_with_national_prefix(self):
"""Returns true if the current country is a NANPA country and the
national number begins with the national prefix.
"""
# For NANPA numbers beginning with 1[2-9], treat the 1 as the national
# prefix. The reason is that national significant numbers in NANPA
# always start with [2-9] after the national prefix. Numbers
# beginning with 1[01] can only be short/emergency numbers, which
# don't need the national prefix.
return (self._current_metadata.country_code == 1 and self._national_number[0] == '1' and
self._national_number[1] != '0' and self._national_number[1] != '1')
def _remove_national_prefix_from_national_number(self):
start_of_national_number = 0
if self._is_nanpa_number_with_national_prefix():
start_of_national_number = 1
self._prefix_before_national_number += unicod("1") + _SEPARATOR_BEFORE_NATIONAL_NUMBER
self._is_complete_number = True
elif self._current_metadata.national_prefix_for_parsing is not None:
npp_re = re.compile(self._current_metadata.national_prefix_for_parsing)
m = npp_re.match(self._national_number)
# Since some national prefix patterns are entirely optional, check
# that a national prefix could actually be extracted.
if m and m.end() > 0:
# When the national prefix is detected, we use international
# formatting rules instead of national ones, because national
# formatting rules could contain local formatting rules for
# numbers entered without area code.
self._is_complete_number = True
start_of_national_number = m.end()
self._prefix_before_national_number += self._national_number[:start_of_national_number]
national_prefix = self._national_number[:start_of_national_number]
self._national_number = self._national_number[start_of_national_number:]
return national_prefix
def _attempt_to_extract_idd(self):
"""Extracts IDD and plus sign to self._prefix_before_national_number
when they are available, and places the remaining input into
_national_number.
Returns True when accrued_input_without_formatting begins with the plus sign or valid IDD for
default_country.
"""
international_prefix = re.compile(unicod("\\") + _PLUS_SIGN + unicod("|") +
(self._current_metadata.international_prefix or U_EMPTY_STRING))
idd_match = international_prefix.match(self._accrued_input_without_formatting)
if idd_match:
self._is_complete_number = True
start_of_country_calling_code = idd_match.end()
self._national_number = self._accrued_input_without_formatting[start_of_country_calling_code:]
self._prefix_before_national_number = self._accrued_input_without_formatting[:start_of_country_calling_code]
if self._accrued_input_without_formatting[0] != _PLUS_SIGN:
self._prefix_before_national_number += _SEPARATOR_BEFORE_NATIONAL_NUMBER
return True
return False
def _attempt_to_extract_ccc(self):
"""Extracts the country calling code from the beginning of
_national_number to _prefix_before_national_number when they are
available, and places the remaining input into _national_number.
Returns True when a valid country calling code can be found.
"""
if len(self._national_number) == 0:
return False
country_code, number_without_ccc = _extract_country_code(self._national_number)
if country_code == 0:
return False
self._national_number = number_without_ccc
new_region_code = region_code_for_country_code(country_code)
if new_region_code == REGION_CODE_FOR_NON_GEO_ENTITY:
self._current_metadata = PhoneMetadata.metadata_for_nongeo_region(country_code)
elif new_region_code != self._default_country:
self._current_metadata = _get_metadata_for_region(new_region_code)
self._prefix_before_national_number += str(country_code)
self._prefix_before_national_number += _SEPARATOR_BEFORE_NATIONAL_NUMBER
# When we have successfully extracted the IDD, the previously
# extracted NDD should be cleared because it is no longer valid.
self._extracted_national_prefix = U_EMPTY_STRING
return True
def _normalize_and_accrue_digits_and_plus_sign(self, next_char, remember_position):
"""Accrues digits and the plus sign to
_accrued_input_without_formatting for later use. If next_char contains
a digit in non-ASCII format (e.g. the full-width version of digits),
it is first normalized to the ASCII version. The return value is
next_char itself, or its normalized version, if next_char is a digit
in non-ASCII format. This method assumes its input is either a digit
or the plus sign."""
if next_char == _PLUS_SIGN:
normalized_char = next_char
self._accrued_input_without_formatting += next_char
else:
next_digit = unicode_digit(next_char, -1)
if next_digit != -1:
normalized_char = unicod(next_digit)
else: # pragma no cover
normalized_char = next_char
self._accrued_input_without_formatting += normalized_char
self._national_number += normalized_char
if remember_position:
self._position_to_remember = len(self._accrued_input_without_formatting)
return normalized_char
def _input_digit_helper(self, next_char):
# Note that formattingTemplate is not guaranteed to have a value, it
# could be empty, e.g. when the next digit is entered after extracting
# an IDD or NDD.
digit_match = _DIGIT_PATTERN.search(self._formatting_template, self._last_match_position)
if digit_match:
# Reset to search for _DIGIT_PLACEHOLDER from start of string
digit_match = _DIGIT_PATTERN.search(self._formatting_template)
temp_template = re.sub(_DIGIT_PATTERN,
next_char,
self._formatting_template,
count=1)
self._formatting_template = temp_template + self._formatting_template[len(temp_template):]
self._last_match_position = digit_match.start()
return self._formatting_template[:self._last_match_position + 1]
else:
if len(self._possible_formats) == 1:
# More digits are entered than we could handle, and there are
# no other valid patterns to try.
self._able_to_format = False
# else, we just reset the formatting pattern.
self._current_formatting_pattern = U_EMPTY_STRING
return self._accrued_input

View file

@ -0,0 +1,61 @@
from re import Pattern
from .util import U_EMPTY_STRING, U_SPACE
from .phonemetadata import NumberFormat
from .phonemetadata import PhoneMetadata
from .phonemetadata import REGION_CODE_FOR_NON_GEO_ENTITY
_SEPARATOR_BEFORE_NATIONAL_NUMBER: str
_EMPTY_METADATA: PhoneMetadata
_NATIONAL_PREFIX_SEPARATORS_PATTERN: Pattern[str]
_ELIGIBLE_FORMAT_PATTERN: Pattern[str]
_MIN_LEADING_DIGITS_LENGTH: int
_DIGIT_PLACEHOLDER: str
_DIGIT_PATTERN: Pattern[str]
def _get_metadata_for_region(region_code: str) -> PhoneMetadata: ...
class AsYouTypeFormatter:
_default_country: str
_current_metadata: PhoneMetadata
_default_metadata: PhoneMetadata
_current_output: str
_accrued_input: str
_accrued_input_without_formatting: str
_formatting_template: str
_last_match_position: int
_current_formatting_pattern: str
_prefix_before_national_number: str
_should_add_space_after_national_prefix: bool
_extracted_national_prefix: str
_national_number: str
_able_to_format: bool
_input_has_formatting: bool
_position_to_remember: int
_original_position: int
_is_complete_number: bool
_is_expecting_country_calling_code: bool
_possible_formats: list[NumberFormat]
def __init__(self, region_code: str) -> None: ...
def _maybe_create_new_template(self) -> bool: ...
def _get_available_formats(self, leading_digits: str) -> None: ...
def _narrow_down_possible_formats(self, leading_digits: str) -> None: ...
def _create_formatting_template(self, num_format: NumberFormat) -> bool: ...
def _get_formatting_template(self, number_pattern: str, number_format: str) -> str: ...
def _clear(self) -> None: ...
def clear(self) -> None: ...
def input_digit(self, next_char: str, remember_position: bool = ...) -> str: ...
def _attempt_to_choose_pattern_with_prefix_extracted(self) -> str: ...
def _able_to_extract_longer_ndd(self) -> bool: ...
def _is_digit_or_leading_plus_sign(self, next_char: str) -> bool: ...
def _attempt_to_format_accrued_digits(self) -> str: ...
def get_remembered_position(self) -> int: ...
def _append_national_number(self, national_number: str) -> str: ...
def _attempt_to_choose_formatting_pattern(self) -> str: ...
def _input_accrued_national_number(self) -> str: ...
def _is_nanpa_number_with_national_prefix(self) -> bool: ...
def _remove_national_prefix_from_national_number(self) -> str: ...
def _attempt_to_extract_idd(self) -> bool: ...
def _attempt_to_extract_ccc(self) -> bool: ...
def _normalize_and_accrue_digits_and_plus_sign(self, next_char: str, remember_position: bool) -> str: ...
def _input_digit_helper(self, next_char: str) -> str: ...

View file

@ -0,0 +1,145 @@
"""Phone number to carrier mapping functionality
>>> import phonenumbers
>>> from phonenumbers.carrier import name_for_number
>>> ro_number = phonenumbers.parse("+40721234567", "RO")
>>> str(name_for_number(ro_number, "en"))
'Vodafone'
>>> str(name_for_number(ro_number, "fr")) # fall back to English
'Vodafone'
"""
# Based very loosely on original Java code:
# java/carrier/src/com/google/i18n/phonenumbers/PhoneNumberToCarrierMapper.java
# Copyright (C) 2013 The Libphonenumber Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from .util import prnt, u, U_EMPTY_STRING
from .phonenumberutil import PhoneNumberType, number_type
from .phonenumberutil import region_code_for_number
from .phonenumberutil import is_mobile_number_portable_region
from .prefix import _prefix_description_for_number
try:
from .carrierdata import CARRIER_DATA, CARRIER_LONGEST_PREFIX
except ImportError: # pragma no cover
# Before the generated code exists, the carrierdata/ directory is empty.
# The generation process imports this module, creating a circular
# dependency. The hack below works around this.
import os
import sys
if (os.path.basename(sys.argv[0]) == "buildmetadatafromxml.py" or
os.path.basename(sys.argv[0]) == "buildprefixdata.py"):
prnt("Failed to import generated data (but OK as during autogeneration)", file=sys.stderr)
CARRIER_DATA = {'1': {'en': u('United States')}}
CARRIER_LONGEST_PREFIX = 1
else:
raise
__all__ = ['name_for_valid_number', 'name_for_number', 'safe_display_name']
def name_for_valid_number(numobj, lang, script=None, region=None):
"""Returns a carrier name for the given PhoneNumber object, in the
language provided.
The carrier name is the one the number was originally allocated to,
however if the country supports mobile number portability the number might
not belong to the returned carrier anymore. If no mapping is found an
empty string is returned.
This method assumes the validity of the number passed in has already been
checked, and that the number is suitable for carrier lookup. We consider
mobile and pager numbers possible candidates for carrier lookup.
Arguments:
numobj -- The PhoneNumber object for which we want to get a carrier name.
lang -- A 2-letter lowercase ISO 639-1 language code for the language in
which the description should be returned (e.g. "en")
script -- A 4-letter titlecase (first letter uppercase, rest lowercase)
ISO script code as defined in ISO 15924, separated by an
underscore (e.g. "Hant")
region -- A 2-letter uppercase ISO 3166-1 country code (e.g. "GB")
Returns a carrier name in the given language code, for the given phone
number, or an empty string if no description is available.
"""
return _prefix_description_for_number(CARRIER_DATA, CARRIER_LONGEST_PREFIX,
numobj, lang, script, region)
def name_for_number(numobj, lang, script=None, region=None):
"""Returns a carrier name for the given PhoneNumber object, in the
language provided.
The carrier name is the one the number was originally allocated to,
however if the country supports mobile number portability the number might
not belong to the returned carrier anymore. If no mapping is found an
empty string is returned.
This function explicitly checks the validity of the number passed in
Arguments:
numobj -- The PhoneNumber object for which we want to get a carrier name.
lang -- A 2-letter lowercase ISO 639-1 language code for the language in
which the description should be returned (e.g. "en")
script -- A 4-letter titlecase (first letter uppercase, rest lowercase)
ISO script code as defined in ISO 15924, separated by an
underscore (e.g. "Hant")
region -- A 2-letter uppercase ISO 3166-1 country code (e.g. "GB")
Returns a carrier name in the given language code, for the given phone
number, or an empty string if no description is available.
"""
ntype = number_type(numobj)
if _is_mobile(ntype):
return name_for_valid_number(numobj, lang, script, region)
return U_EMPTY_STRING
def safe_display_name(numobj, lang, script=None, region=None):
"""Gets the name of the carrier for the given PhoneNumber object only when
it is 'safe' to display to users. A carrier name is onsidered safe if the
number is valid and for a region that doesn't support mobile number
portability (http://en.wikipedia.org/wiki/Mobile_number_portability).
This function explicitly checks the validity of the number passed in
Arguments:
numobj -- The PhoneNumber object for which we want to get a carrier name.
lang -- A 2-letter lowercase ISO 639-1 language code for the language in
which the description should be returned (e.g. "en")
script -- A 4-letter titlecase (first letter uppercase, rest lowercase)
ISO script code as defined in ISO 15924, separated by an
underscore (e.g. "Hant")
region -- A 2-letter uppercase ISO 3166-1 country code (e.g. "GB")
Returns a carrier name that is safe to display to users, or the empty string.
"""
if is_mobile_number_portable_region(region_code_for_number(numobj)):
return U_EMPTY_STRING
return name_for_number(numobj, lang, script, region)
def _is_mobile(ntype):
"""Checks if the supplied number type supports carrier lookup"""
return (ntype == PhoneNumberType.MOBILE or
ntype == PhoneNumberType.FIXED_LINE_OR_MOBILE or
ntype == PhoneNumberType.PAGER)
if __name__ == '__main__': # pragma no cover
import doctest
doctest.testmod()

View file

@ -0,0 +1,8 @@
from .phonenumber import PhoneNumber
__all__: list[str]
def name_for_valid_number(numobj: PhoneNumber, lang: str, script: str | None = ..., region: str | None = ...) -> str: ...
def name_for_number(numobj: PhoneNumber, lang: str, script: str | None = ..., region: str | None = ...) -> str: ...
def safe_display_name(numobj: PhoneNumber, lang: str, script: str | None = ..., region: str | None = ...) -> str: ...
def _is_mobile(ntype: int) -> bool: ...

View file

@ -0,0 +1,29 @@
"""Per-prefix data, mapping each prefix to a dict of locale:name.
Auto-generated file, do not edit by hand.
"""
from ..util import u
# Copyright (C) 2011-2024 The Libphonenumber Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
CARRIER_DATA = {}
from .data0 import data
CARRIER_DATA.update(data)
from .data1 import data
CARRIER_DATA.update(data)
from .data2 import data
CARRIER_DATA.update(data)
del data
CARRIER_LONGEST_PREFIX = 9

View file

@ -0,0 +1,2 @@
CARRIER_DATA: dict[str, dict[str, str]]
CARRIER_LONGEST_PREFIX: int

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,301 @@
"""Auto-generated file, do not edit by hand."""
# Copyright (C) 2010-2024 The Libphonenumber Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from ..phonemetadata import PhoneMetadata
_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']
_AVAILABLE_NONGEO_COUNTRY_CODES = [800, 808, 870, 878, 881, 882, 883, 888, 979]
def _load_region(code):
__import__("region_%s" % code, globals(), locals(),
fromlist=["PHONE_METADATA_%s" % code], level=1)
for _region_code in _AVAILABLE_REGION_CODES:
PhoneMetadata.register_region_loader(_region_code, _load_region)
for _country_code in _AVAILABLE_NONGEO_COUNTRY_CODES:
PhoneMetadata.register_nongeo_region_loader(_country_code, _load_region)
from .alt_format_255 import PHONE_ALT_FORMAT_255
from .alt_format_27 import PHONE_ALT_FORMAT_27
from .alt_format_30 import PHONE_ALT_FORMAT_30
from .alt_format_31 import PHONE_ALT_FORMAT_31
from .alt_format_34 import PHONE_ALT_FORMAT_34
from .alt_format_350 import PHONE_ALT_FORMAT_350
from .alt_format_351 import PHONE_ALT_FORMAT_351
from .alt_format_352 import PHONE_ALT_FORMAT_352
from .alt_format_358 import PHONE_ALT_FORMAT_358
from .alt_format_359 import PHONE_ALT_FORMAT_359
from .alt_format_36 import PHONE_ALT_FORMAT_36
from .alt_format_372 import PHONE_ALT_FORMAT_372
from .alt_format_373 import PHONE_ALT_FORMAT_373
from .alt_format_380 import PHONE_ALT_FORMAT_380
from .alt_format_381 import PHONE_ALT_FORMAT_381
from .alt_format_385 import PHONE_ALT_FORMAT_385
from .alt_format_39 import PHONE_ALT_FORMAT_39
from .alt_format_43 import PHONE_ALT_FORMAT_43
from .alt_format_44 import PHONE_ALT_FORMAT_44
from .alt_format_49 import PHONE_ALT_FORMAT_49
from .alt_format_505 import PHONE_ALT_FORMAT_505
from .alt_format_506 import PHONE_ALT_FORMAT_506
from .alt_format_52 import PHONE_ALT_FORMAT_52
from .alt_format_54 import PHONE_ALT_FORMAT_54
from .alt_format_55 import PHONE_ALT_FORMAT_55
from .alt_format_58 import PHONE_ALT_FORMAT_58
from .alt_format_595 import PHONE_ALT_FORMAT_595
from .alt_format_61 import PHONE_ALT_FORMAT_61
from .alt_format_62 import PHONE_ALT_FORMAT_62
from .alt_format_64 import PHONE_ALT_FORMAT_64
from .alt_format_66 import PHONE_ALT_FORMAT_66
from .alt_format_675 import PHONE_ALT_FORMAT_675
from .alt_format_676 import PHONE_ALT_FORMAT_676
from .alt_format_679 import PHONE_ALT_FORMAT_679
from .alt_format_7 import PHONE_ALT_FORMAT_7
from .alt_format_81 import PHONE_ALT_FORMAT_81
from .alt_format_84 import PHONE_ALT_FORMAT_84
from .alt_format_855 import PHONE_ALT_FORMAT_855
from .alt_format_856 import PHONE_ALT_FORMAT_856
from .alt_format_90 import PHONE_ALT_FORMAT_90
from .alt_format_91 import PHONE_ALT_FORMAT_91
from .alt_format_94 import PHONE_ALT_FORMAT_94
from .alt_format_95 import PHONE_ALT_FORMAT_95
from .alt_format_971 import PHONE_ALT_FORMAT_971
from .alt_format_972 import PHONE_ALT_FORMAT_972
from .alt_format_995 import PHONE_ALT_FORMAT_995
_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}
# A mapping from a country code to the region codes which
# denote the country/region represented by that country code.
# In the case of multiple countries sharing a calling code,
# such as the NANPA countries, the one indicated with
# "main_country_for_code" in the metadata should be first.
_COUNTRY_CODE_TO_REGION_CODE = {
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",),
7: ("RU", "KZ",),
20: ("EG",),
27: ("ZA",),
30: ("GR",),
31: ("NL",),
32: ("BE",),
33: ("FR",),
34: ("ES",),
36: ("HU",),
39: ("IT", "VA",),
40: ("RO",),
41: ("CH",),
43: ("AT",),
44: ("GB", "GG", "IM", "JE",),
45: ("DK",),
46: ("SE",),
47: ("NO", "SJ",),
48: ("PL",),
49: ("DE",),
51: ("PE",),
52: ("MX",),
53: ("CU",),
54: ("AR",),
55: ("BR",),
56: ("CL",),
57: ("CO",),
58: ("VE",),
60: ("MY",),
61: ("AU", "CC", "CX",),
62: ("ID",),
63: ("PH",),
64: ("NZ",),
65: ("SG",),
66: ("TH",),
81: ("JP",),
82: ("KR",),
84: ("VN",),
86: ("CN",),
90: ("TR",),
91: ("IN",),
92: ("PK",),
93: ("AF",),
94: ("LK",),
95: ("MM",),
98: ("IR",),
211: ("SS",),
212: ("MA", "EH",),
213: ("DZ",),
216: ("TN",),
218: ("LY",),
220: ("GM",),
221: ("SN",),
222: ("MR",),
223: ("ML",),
224: ("GN",),
225: ("CI",),
226: ("BF",),
227: ("NE",),
228: ("TG",),
229: ("BJ",),
230: ("MU",),
231: ("LR",),
232: ("SL",),
233: ("GH",),
234: ("NG",),
235: ("TD",),
236: ("CF",),
237: ("CM",),
238: ("CV",),
239: ("ST",),
240: ("GQ",),
241: ("GA",),
242: ("CG",),
243: ("CD",),
244: ("AO",),
245: ("GW",),
246: ("IO",),
247: ("AC",),
248: ("SC",),
249: ("SD",),
250: ("RW",),
251: ("ET",),
252: ("SO",),
253: ("DJ",),
254: ("KE",),
255: ("TZ",),
256: ("UG",),
257: ("BI",),
258: ("MZ",),
260: ("ZM",),
261: ("MG",),
262: ("RE", "YT",),
263: ("ZW",),
264: ("NA",),
265: ("MW",),
266: ("LS",),
267: ("BW",),
268: ("SZ",),
269: ("KM",),
290: ("SH", "TA",),
291: ("ER",),
297: ("AW",),
298: ("FO",),
299: ("GL",),
350: ("GI",),
351: ("PT",),
352: ("LU",),
353: ("IE",),
354: ("IS",),
355: ("AL",),
356: ("MT",),
357: ("CY",),
358: ("FI", "AX",),
359: ("BG",),
370: ("LT",),
371: ("LV",),
372: ("EE",),
373: ("MD",),
374: ("AM",),
375: ("BY",),
376: ("AD",),
377: ("MC",),
378: ("SM",),
380: ("UA",),
381: ("RS",),
382: ("ME",),
383: ("XK",),
385: ("HR",),
386: ("SI",),
387: ("BA",),
389: ("MK",),
420: ("CZ",),
421: ("SK",),
423: ("LI",),
500: ("FK",),
501: ("BZ",),
502: ("GT",),
503: ("SV",),
504: ("HN",),
505: ("NI",),
506: ("CR",),
507: ("PA",),
508: ("PM",),
509: ("HT",),
590: ("GP", "BL", "MF",),
591: ("BO",),
592: ("GY",),
593: ("EC",),
594: ("GF",),
595: ("PY",),
596: ("MQ",),
597: ("SR",),
598: ("UY",),
599: ("CW", "BQ",),
670: ("TL",),
672: ("NF",),
673: ("BN",),
674: ("NR",),
675: ("PG",),
676: ("TO",),
677: ("SB",),
678: ("VU",),
679: ("FJ",),
680: ("PW",),
681: ("WF",),
682: ("CK",),
683: ("NU",),
685: ("WS",),
686: ("KI",),
687: ("NC",),
688: ("TV",),
689: ("PF",),
690: ("TK",),
691: ("FM",),
692: ("MH",),
800: ("001",),
808: ("001",),
850: ("KP",),
852: ("HK",),
853: ("MO",),
855: ("KH",),
856: ("LA",),
870: ("001",),
878: ("001",),
880: ("BD",),
881: ("001",),
882: ("001",),
883: ("001",),
886: ("TW",),
888: ("001",),
960: ("MV",),
961: ("LB",),
962: ("JO",),
963: ("SY",),
964: ("IQ",),
965: ("KW",),
966: ("SA",),
967: ("YE",),
968: ("OM",),
970: ("PS",),
971: ("AE",),
972: ("IL",),
973: ("BH",),
974: ("QA",),
975: ("BT",),
976: ("MN",),
977: ("NP",),
979: ("001",),
992: ("TJ",),
993: ("TM",),
994: ("AZ",),
995: ("GE",),
996: ("KG",),
998: ("UZ",),
}

View file

@ -0,0 +1,55 @@
from ..phonemetadata import NumberFormat
from .alt_format_255 import PHONE_ALT_FORMAT_255
from .alt_format_27 import PHONE_ALT_FORMAT_27
from .alt_format_30 import PHONE_ALT_FORMAT_30
from .alt_format_31 import PHONE_ALT_FORMAT_31
from .alt_format_34 import PHONE_ALT_FORMAT_34
from .alt_format_350 import PHONE_ALT_FORMAT_350
from .alt_format_351 import PHONE_ALT_FORMAT_351
from .alt_format_352 import PHONE_ALT_FORMAT_352
from .alt_format_358 import PHONE_ALT_FORMAT_358
from .alt_format_359 import PHONE_ALT_FORMAT_359
from .alt_format_36 import PHONE_ALT_FORMAT_36
from .alt_format_372 import PHONE_ALT_FORMAT_372
from .alt_format_373 import PHONE_ALT_FORMAT_373
from .alt_format_380 import PHONE_ALT_FORMAT_380
from .alt_format_381 import PHONE_ALT_FORMAT_381
from .alt_format_385 import PHONE_ALT_FORMAT_385
from .alt_format_39 import PHONE_ALT_FORMAT_39
from .alt_format_43 import PHONE_ALT_FORMAT_43
from .alt_format_44 import PHONE_ALT_FORMAT_44
from .alt_format_49 import PHONE_ALT_FORMAT_49
from .alt_format_505 import PHONE_ALT_FORMAT_505
from .alt_format_506 import PHONE_ALT_FORMAT_506
from .alt_format_52 import PHONE_ALT_FORMAT_52
from .alt_format_54 import PHONE_ALT_FORMAT_54
from .alt_format_55 import PHONE_ALT_FORMAT_55
from .alt_format_58 import PHONE_ALT_FORMAT_58
from .alt_format_595 import PHONE_ALT_FORMAT_595
from .alt_format_61 import PHONE_ALT_FORMAT_61
from .alt_format_62 import PHONE_ALT_FORMAT_62
from .alt_format_64 import PHONE_ALT_FORMAT_64
from .alt_format_66 import PHONE_ALT_FORMAT_66
from .alt_format_675 import PHONE_ALT_FORMAT_675
from .alt_format_676 import PHONE_ALT_FORMAT_676
from .alt_format_679 import PHONE_ALT_FORMAT_679
from .alt_format_7 import PHONE_ALT_FORMAT_7
from .alt_format_81 import PHONE_ALT_FORMAT_81
from .alt_format_84 import PHONE_ALT_FORMAT_84
from .alt_format_855 import PHONE_ALT_FORMAT_855
from .alt_format_856 import PHONE_ALT_FORMAT_856
from .alt_format_90 import PHONE_ALT_FORMAT_90
from .alt_format_91 import PHONE_ALT_FORMAT_91
from .alt_format_94 import PHONE_ALT_FORMAT_94
from .alt_format_95 import PHONE_ALT_FORMAT_95
from .alt_format_971 import PHONE_ALT_FORMAT_971
from .alt_format_972 import PHONE_ALT_FORMAT_972
from .alt_format_995 import PHONE_ALT_FORMAT_995
_AVAILABLE_REGION_CODES: list[str]
_AVAILABLE_NONGEO_COUNTRY_CODES: list[int]
def _load_region(code: str | int) -> None: ...
_ALT_NUMBER_FORMATS: dict[int, list[NumberFormat]]
_COUNTRY_CODE_TO_REGION_CODE: dict[int, tuple[str, ...]]

View file

@ -0,0 +1,4 @@
"""Auto-generated file, do not edit by hand. 255 metadata"""
from ..phonemetadata import NumberFormat
PHONE_ALT_FORMAT_255 = [NumberFormat(pattern='(\\d{2})(\\d{3})(\\d{4})', format='\\1 \\2 \\3', leading_digits_pattern=['[67]']), NumberFormat(pattern='(\\d{2})(\\d{4})(\\d{3})', format='\\1 \\2 \\3', leading_digits_pattern=['[67]'])]

View file

@ -0,0 +1,4 @@
"""Auto-generated file, do not edit by hand. 27 metadata"""
from ..phonemetadata import NumberFormat
PHONE_ALT_FORMAT_27 = [NumberFormat(pattern='(\\d{3})(\\d{3})(\\d{3})', format='\\1 \\2 \\3', leading_digits_pattern=['86[1-9]'])]

View file

@ -0,0 +1,4 @@
"""Auto-generated file, do not edit by hand. 30 metadata"""
from ..phonemetadata import NumberFormat
PHONE_ALT_FORMAT_30 = [NumberFormat(pattern='(\\d{3})(\\d{3})(\\d{4})', format='\\1 \\2 \\3', leading_digits_pattern=['21'])]

View file

@ -0,0 +1,4 @@
"""Auto-generated file, do not edit by hand. 31 metadata"""
from ..phonemetadata import NumberFormat
PHONE_ALT_FORMAT_31 = [NumberFormat(pattern='(\\d{2})(\\d{4})(\\d{3})', format='\\1 \\2 \\3', leading_digits_pattern=['1[035]|2[0346]|3[03568]|4[0356]|5[0358]|7|8[4578]|91']), NumberFormat(pattern='(\\d{3})(\\d{2})(\\d{2})(\\d{2})', format='\\1 \\2 \\3 \\4', leading_digits_pattern=['1[16-8]|2[259]|3[124]|4[17-9]|5[124679]'])]

View file

@ -0,0 +1,4 @@
"""Auto-generated file, do not edit by hand. 34 metadata"""
from ..phonemetadata import NumberFormat
PHONE_ALT_FORMAT_34 = [NumberFormat(pattern='(\\d{3})(\\d{3})(\\d{3})', format='\\1 \\2 \\3', leading_digits_pattern=['[5-7]|80[367]|90[12]|[89][1-8]']), NumberFormat(pattern='(\\d{2})(\\d{3})(\\d{2})(\\d{2})', format='\\1 \\2 \\3 \\4', leading_digits_pattern=['9(?:0[12]|[1-8])'])]

View file

@ -0,0 +1,4 @@
"""Auto-generated file, do not edit by hand. 350 metadata"""
from ..phonemetadata import NumberFormat
PHONE_ALT_FORMAT_350 = [NumberFormat(pattern='(\\d{4})(\\d{4})', format='\\1 \\2', leading_digits_pattern=['2'])]

View file

@ -0,0 +1,4 @@
"""Auto-generated file, do not edit by hand. 351 metadata"""
from ..phonemetadata import NumberFormat
PHONE_ALT_FORMAT_351 = [NumberFormat(pattern='(\\d{3})(\\d{3})(\\d{3})', format='\\1 \\2 \\3', leading_digits_pattern=['2[12]']), NumberFormat(pattern='(\\d{2})(\\d{3})(\\d{2})(\\d{2})', format='\\1 \\2 \\3 \\4', leading_digits_pattern=['2[12]|9']), NumberFormat(pattern='(\\d{2})(\\d{3})(\\d{4})', format='\\1 \\2 \\3', leading_digits_pattern=['9'])]

View file

@ -0,0 +1,4 @@
"""Auto-generated file, do not edit by hand. 352 metadata"""
from ..phonemetadata import NumberFormat
PHONE_ALT_FORMAT_352 = [NumberFormat(pattern='(\\d{2})(\\d{3})(\\d{3})', format='\\1 \\2 \\3', leading_digits_pattern=['2(?:[0367]|4[3-8])'])]

View file

@ -0,0 +1,4 @@
"""Auto-generated file, do not edit by hand. 358 metadata"""
from ..phonemetadata import NumberFormat
PHONE_ALT_FORMAT_358 = [NumberFormat(pattern='(\\d)(\\d{3})(\\d{3,4})', format='\\1 \\2 \\3', leading_digits_pattern=['[2568][1-8]|3(?:0[1-9]|[1-9])|9']), NumberFormat(pattern='(\\d{2})(\\d{3})(\\d{3,4})', format='\\1 \\2 \\3', leading_digits_pattern=['[12]0[1-9]|4|1[3-9]|29|50|7[15]']), NumberFormat(pattern='(\\d)(\\d{4})(\\d{3})', format='\\1 \\2 \\3', leading_digits_pattern=['[2568][1-8]|3(?:0[1-9]|[1-9])|9'])]

View file

@ -0,0 +1,4 @@
"""Auto-generated file, do not edit by hand. 359 metadata"""
from ..phonemetadata import NumberFormat
PHONE_ALT_FORMAT_359 = [NumberFormat(pattern='(\\d)(\\d{3})(\\d{2})(\\d{2})', format='\\1 \\2 \\3 \\4', leading_digits_pattern=['2']), NumberFormat(pattern='(\\d{3})(\\d{3})(\\d{3})', format='\\1 \\2 \\3', leading_digits_pattern=['8|98']), NumberFormat(pattern='(\\d{3})(\\d{2})(\\d{2})(\\d{2})', format='\\1 \\2 \\3 \\4', leading_digits_pattern=['8|98'])]

View file

@ -0,0 +1,4 @@
"""Auto-generated file, do not edit by hand. 36 metadata"""
from ..phonemetadata import NumberFormat
PHONE_ALT_FORMAT_36 = [NumberFormat(pattern='(\\d)(\\d{4})(\\d{3})', format='\\1 \\2 \\3', leading_digits_pattern=['1']), NumberFormat(pattern='(\\d{2})(\\d{4})(\\d{3})', format='\\1 \\2 \\3')]

View file

@ -0,0 +1,4 @@
"""Auto-generated file, do not edit by hand. 372 metadata"""
from ..phonemetadata import NumberFormat
PHONE_ALT_FORMAT_372 = [NumberFormat(pattern='(\\d)(\\d{3})(\\d{3})', format='\\1 \\2 \\3', leading_digits_pattern=['6']), NumberFormat(pattern='(\\d{2})(\\d{2})(\\d{3})', format='\\1 \\2 \\3', leading_digits_pattern=['[4-79]']), NumberFormat(pattern='(\\d{2})(\\d{3})(\\d{2})', format='\\1 \\2 \\3', leading_digits_pattern=['[4-79]'])]

View file

@ -0,0 +1,4 @@
"""Auto-generated file, do not edit by hand. 373 metadata"""
from ..phonemetadata import NumberFormat
PHONE_ALT_FORMAT_373 = [NumberFormat(pattern='(\\d{2})(\\d{2})(\\d{2})(\\d{2})', format='\\1 \\2 \\3 \\4', leading_digits_pattern=['22|[367]']), NumberFormat(pattern='(\\d{2})(\\d{3})(\\d{3})', format='\\1 \\2 \\3', leading_digits_pattern=['[67]'])]

View file

@ -0,0 +1,4 @@
"""Auto-generated file, do not edit by hand. 380 metadata"""
from ..phonemetadata import NumberFormat
PHONE_ALT_FORMAT_380 = [NumberFormat(pattern='(\\d{2})(\\d{3})(\\d{2})(\\d{2})', format='\\1 \\2 \\3 \\4', leading_digits_pattern=['[38]9|4[45][0-5]|5(?:0|6(?:3[14-7]|7))|6(?:[12][018]|[36-8])|7|9[1-9]|(?:48|57)[0137-9]']), NumberFormat(pattern='(\\d{2})(\\d{2})(\\d{3})(\\d{2})', format='\\1 \\2 \\3 \\4', leading_digits_pattern=['[38]9|4[45][0-5]|5(?:0|6(?:3[14-7]|7))|6(?:[12][018]|[36-8])|7|9[1-9]|(?:48|57)[0137-9]'])]

View file

@ -0,0 +1,4 @@
"""Auto-generated file, do not edit by hand. 381 metadata"""
from ..phonemetadata import NumberFormat
PHONE_ALT_FORMAT_381 = [NumberFormat(pattern='(\\d{2})(\\d{3})(\\d{3})', format='\\1 \\2 \\3', leading_digits_pattern=['[16]|2[0-24-7]|3[0-8]|(?:2[389]|39)[2-9]']), NumberFormat(pattern='(\\d{2})(\\d{2})(\\d{2})(\\d{3})', format='\\1 \\2 \\3 \\4', leading_digits_pattern=['1|2[0-24-7]|3[0-8]|(?:2[389]|39)[2-9]']), NumberFormat(pattern='(\\d{2})(\\d{3})(\\d{2})(\\d{2})', format='\\1 \\2 \\3 \\4', leading_digits_pattern=['6'])]

View file

@ -0,0 +1,4 @@
"""Auto-generated file, do not edit by hand. 385 metadata"""
from ..phonemetadata import NumberFormat
PHONE_ALT_FORMAT_385 = [NumberFormat(pattern='(\\d)(\\d{3})(\\d{4})', format='\\1 \\2 \\3', leading_digits_pattern=['1']), NumberFormat(pattern='(\\d)(\\d{3})(\\d{2})(\\d{2})', format='\\1 \\2 \\3 \\4', leading_digits_pattern=['1']), NumberFormat(pattern='(\\d{2})(\\d{2})(\\d{4})', format='\\1 \\2 \\3', leading_digits_pattern=['[2-69]']), NumberFormat(pattern='(\\d{2})(\\d{3})(\\d{4})', format='\\1 \\2 \\3', leading_digits_pattern=['6'])]

View file

@ -0,0 +1,4 @@
"""Auto-generated file, do not edit by hand. 39 metadata"""
from ..phonemetadata import NumberFormat
PHONE_ALT_FORMAT_39 = [NumberFormat(pattern='(\\d{4})(\\d{2})(\\d{2})(\\d{2})', format='\\1 \\2 \\3 \\4', leading_digits_pattern=['0(?:[13-579][2-46-8]|8[236-8])']), NumberFormat(pattern='(\\d{4})(\\d{2})(\\d{3})', format='\\1 \\2 \\3', leading_digits_pattern=['0(?:[13-579][2-46-8]|8[236-8])'])]

View file

@ -0,0 +1,4 @@
"""Auto-generated file, do not edit by hand. 43 metadata"""
from ..phonemetadata import NumberFormat
PHONE_ALT_FORMAT_43 = [NumberFormat(pattern='(\\d)(\\d{3})(\\d{2})(\\d{2,3})', format='\\1 \\2 \\3 \\4', leading_digits_pattern=['1']), NumberFormat(pattern='(\\d)(\\d{4,6})', format='\\1 \\2', leading_digits_pattern=['5[079]']), NumberFormat(pattern='(\\d)(\\d{7,8})', format='\\1 \\2', leading_digits_pattern=['5[079]']), NumberFormat(pattern='(\\d{2})(\\d{2})(\\d{2})(\\d{2,3})', format='\\1 \\2 \\3 \\4', leading_digits_pattern=['5[079]']), NumberFormat(pattern='(\\d{2})(\\d{6,7})', format='\\1 \\2', leading_digits_pattern=['5[079]']), NumberFormat(pattern='(\\d)(\\d{9,12})', format='\\1 \\2', leading_digits_pattern=['5[079]']), NumberFormat(pattern='(\\d{2})(\\d{2})(\\d{2})(\\d{4})', format='\\1 \\2 \\3 \\4', leading_digits_pattern=['5[079]']), NumberFormat(pattern='(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2,4})', format='\\1 \\2 \\3 \\4 \\5', leading_digits_pattern=['5[079]']), NumberFormat(pattern='(\\d{2})(\\d{5})(\\d{4,6})', format='\\1 \\2 \\3', leading_digits_pattern=['5[079]']), NumberFormat(pattern='(\\d{3})(\\d{3})(\\d{3})(\\d{3,4})', format='\\1 \\2 \\3 \\4', leading_digits_pattern=['(?:31|4)6|51|6(?:5[0-3579]|[6-9])|7(?:20|32|8)|[89]']), NumberFormat(pattern='(\\d{3})(\\d{3})(\\d{2})(\\d{2,3})', format='\\1 \\2 \\3 \\4', leading_digits_pattern=['(?:31|4)6|51|6(?:5[0-3579]|[6-9])|7(?:20|32|8)|[89]']), NumberFormat(pattern='(\\d{3})(\\d{2})(\\d{2})(\\d{2,3})', format='\\1 \\2 \\3 \\4', leading_digits_pattern=['(?:31|4)6|51|6(?:5[0-3579]|[6-9])|7(?:20|32|8)|[89]']), NumberFormat(pattern='(\\d{4})(\\d{3})(\\d{3,4})', format='\\1 \\2 \\3', leading_digits_pattern=['2|3(?:1[1-578]|[3-68])|4[2378]|5[2-6]|6(?:[124]|5[468])|7(?:2[1-8]|35|[4-79])'])]

View file

@ -0,0 +1,4 @@
"""Auto-generated file, do not edit by hand. 44 metadata"""
from ..phonemetadata import NumberFormat
PHONE_ALT_FORMAT_44 = [NumberFormat(pattern='(\\d{3})(\\d{3})(\\d{4})', format='\\1 \\2 \\3', leading_digits_pattern=['20']), NumberFormat(pattern='(\\d{3})(\\d{4})(\\d{3})', format='\\1 \\2 \\3', leading_digits_pattern=['1(?:1|[2-69]1)|20|[389]|7(?:[1-57-9]|624)']), NumberFormat(pattern='(\\d{2})(\\d{4})(\\d{2})(\\d{2})', format='\\1 \\2 \\3 \\4', leading_digits_pattern=['20']), NumberFormat(pattern='(\\d{4})(\\d{3})(\\d{3})', format='\\1 \\2 \\3', leading_digits_pattern=['1(?:[2-69][02-9]|[78])|3|7(?:[1-57-9]|624)']), NumberFormat(pattern='(\\d{3})(\\d{3})(\\d{3})', format='\\1 \\2 \\3', leading_digits_pattern=['8'])]

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,4 @@
"""Auto-generated file, do not edit by hand. 505 metadata"""
from ..phonemetadata import NumberFormat
PHONE_ALT_FORMAT_505 = [NumberFormat(pattern='(\\d)(\\d{3})(\\d{4})', format='\\1 \\2 \\3', leading_digits_pattern=['2'])]

View file

@ -0,0 +1,4 @@
"""Auto-generated file, do not edit by hand. 506 metadata"""
from ..phonemetadata import NumberFormat
PHONE_ALT_FORMAT_506 = [NumberFormat(pattern='(\\d{4})(\\d{2})(\\d{2})', format='\\1 \\2 \\3')]

View file

@ -0,0 +1,4 @@
"""Auto-generated file, do not edit by hand. 52 metadata"""
from ..phonemetadata import NumberFormat
PHONE_ALT_FORMAT_52 = [NumberFormat(pattern='(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})', format='\\1 \\2 \\3 \\4 \\5', leading_digits_pattern=['33|5[56]|81']), NumberFormat(pattern='(\\d{3})(\\d{3})(\\d{2})(\\d{2})', format='\\1 \\2 \\3 \\4', leading_digits_pattern=['[24679]|3[0-2457-9]|5[089]|8[02-46-9]'])]

View file

@ -0,0 +1,4 @@
"""Auto-generated file, do not edit by hand. 54 metadata"""
from ..phonemetadata import NumberFormat
PHONE_ALT_FORMAT_54 = [NumberFormat(pattern='(\\d{4})(\\d{3})(\\d{3})', format='\\1 \\2 \\3', leading_digits_pattern=['2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04-79]|3[5-8]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)']), NumberFormat(pattern='(\\d)(\\d{4})(\\d{3})(\\d{3})', format='\\1 \\2 \\3 \\4', leading_digits_pattern=['9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))'])]

View file

@ -0,0 +1,4 @@
"""Auto-generated file, do not edit by hand. 55 metadata"""
from ..phonemetadata import NumberFormat
PHONE_ALT_FORMAT_55 = [NumberFormat(pattern='(\\d{2})(\\d{8})', format='\\1 \\2', leading_digits_pattern=['[12467]|3[1-578]|5[13-5]|[89][1-9]'])]

View file

@ -0,0 +1,4 @@
"""Auto-generated file, do not edit by hand. 58 metadata"""
from ..phonemetadata import NumberFormat
PHONE_ALT_FORMAT_58 = [NumberFormat(pattern='(\\d{3})(\\d{3})(\\d{4})', format='\\1 \\2 \\3')]

View file

@ -0,0 +1,4 @@
"""Auto-generated file, do not edit by hand. 595 metadata"""
from ..phonemetadata import NumberFormat
PHONE_ALT_FORMAT_595 = [NumberFormat(pattern='(\\d{2})(\\d{2})(\\d{3})', format='\\1 \\2 \\3', leading_digits_pattern=['[26]1|3[289]|4[1246-8]|7[1-3]|8[1-36]']), NumberFormat(pattern='(\\d{2})(\\d{6,7})', format='\\1 \\2', leading_digits_pattern=['2[14-68]|3[26-9]|4[1246-8]|6(?:1|75)|7[1-35]|8[1-36]']), NumberFormat(pattern='(\\d{3})(\\d{6})', format='\\1 \\2', leading_digits_pattern=['2[279]|3[13-5]|4[359]|5[1-5]|6(?:[34]|7[1-46-8])|7[46-8]|85'])]

View file

@ -0,0 +1,4 @@
"""Auto-generated file, do not edit by hand. 61 metadata"""
from ..phonemetadata import NumberFormat
PHONE_ALT_FORMAT_61 = [NumberFormat(pattern='(\\d{4})(\\d{2})(\\d{2})(\\d{2})', format='\\1 \\2 \\3 \\4'), NumberFormat(pattern='(\\d{4})(\\d{6})', format='\\1 \\2'), NumberFormat(pattern='(\\d)(\\d{3})(\\d{3})(\\d{3})', format='\\1 \\2 \\3 \\4'), NumberFormat(pattern='(\\d)(\\d{8})', format='\\1 \\2', leading_digits_pattern=['[2378]'])]

View file

@ -0,0 +1,4 @@
"""Auto-generated file, do not edit by hand. 62 metadata"""
from ..phonemetadata import NumberFormat
PHONE_ALT_FORMAT_62 = [NumberFormat(pattern='(\\d{2})(\\d{3,4})(\\d{4})', format='\\1 \\2 \\3', leading_digits_pattern=['2[124]|[36]1']), NumberFormat(pattern='(\\d{2})(\\d{3})(\\d{5})', format='\\1 \\2 \\3', leading_digits_pattern=['2[124]|[36]1']), NumberFormat(pattern='(\\d{2})(\\d{2})(\\d{3})(\\d{3})', format='\\1 \\2 \\3 \\4', leading_digits_pattern=['2[124]|[36]1']), NumberFormat(pattern='(\\d{3})(\\d{3})(\\d{4})', format='\\1 \\2 \\3', leading_digits_pattern=['8[1-35-9]']), NumberFormat(pattern='(\\d{3})(\\d{3})(\\d{5,6})', format='\\1 \\2 \\3', leading_digits_pattern=['8']), NumberFormat(pattern='(\\d{3})(\\d{3})(\\d{2})(\\d{3})', format='\\1 \\2 \\3 \\4', leading_digits_pattern=['8'])]

View file

@ -0,0 +1,4 @@
"""Auto-generated file, do not edit by hand. 64 metadata"""
from ..phonemetadata import NumberFormat
PHONE_ALT_FORMAT_64 = [NumberFormat(pattern='(\\d)(\\d{4})(\\d{3})', format='\\1 \\2 \\3', leading_digits_pattern=['[3467]|9[2-9]']), NumberFormat(pattern='(\\d{3})(\\d{3})(\\d{2})', format='\\1 \\2 \\3', leading_digits_pattern=['[89]0'])]

View file

@ -0,0 +1,4 @@
"""Auto-generated file, do not edit by hand. 66 metadata"""
from ..phonemetadata import NumberFormat
PHONE_ALT_FORMAT_66 = [NumberFormat(pattern='(\\d{4})(\\d{4})', format='\\1 \\2', leading_digits_pattern=['2'])]

View file

@ -0,0 +1,4 @@
"""Auto-generated file, do not edit by hand. 675 metadata"""
from ..phonemetadata import NumberFormat
PHONE_ALT_FORMAT_675 = [NumberFormat(pattern='(\\d{3})(\\d{2})(\\d{3})', format='\\1 \\2 \\3', leading_digits_pattern=['7'])]

View file

@ -0,0 +1,4 @@
"""Auto-generated file, do not edit by hand. 676 metadata"""
from ..phonemetadata import NumberFormat
PHONE_ALT_FORMAT_676 = [NumberFormat(pattern='(\\d{2})(\\d{5})', format='\\1 \\2', leading_digits_pattern=['[5-9]'])]

View file

@ -0,0 +1,4 @@
"""Auto-generated file, do not edit by hand. 679 metadata"""
from ..phonemetadata import NumberFormat
PHONE_ALT_FORMAT_679 = [NumberFormat(pattern='(\\d{2})(\\d{3})(\\d{2})', format='\\1 \\2 \\3', leading_digits_pattern=['7'])]

View file

@ -0,0 +1,4 @@
"""Auto-generated file, do not edit by hand. 7 metadata"""
from ..phonemetadata import NumberFormat
PHONE_ALT_FORMAT_7 = [NumberFormat(pattern='(\\d{4})(\\d{3})(\\d{3})', format='\\1 \\2 \\3', leading_digits_pattern=['[3489]|7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:1[23]|[2-9]2))']), NumberFormat(pattern='(\\d{5})(\\d{5})', format='\\1 \\2', leading_digits_pattern=['[3489]|72(?:6|7[457])|7(?:12|2[49])[35]|7(?:1[13-58]|2[1-38])[3-5]|7(?:1[06]|25)[3-6]']), NumberFormat(pattern='(\\d{3})(\\d{3})(\\d{2})(\\d{2})', format='\\1 \\2 \\3 \\4', leading_digits_pattern=['7(?:1|2(?:[1-689]|7[2457]))']), NumberFormat(pattern='(\\d{3})(\\d{2})(\\d{2})(\\d{3})', format='\\1 \\2 \\3 \\4', leading_digits_pattern=['[3489]|7(?:[04-9]|1(?:04|[236]3|4[3-5]|5[34])|2(?:13|34|7[39]))']), NumberFormat(pattern='(\\d{3})(\\d)(\\d{2})(\\d{2})(\\d{2})', format='\\1 \\2 \\3 \\4 \\5', leading_digits_pattern=['[3489]|7(?:[04-9]|1(?:04|[236]3|4[3-5]|5[34])|2(?:13|34|7[39]))']), NumberFormat(pattern='(\\d{4})(\\d{2})(\\d{2})(\\d{2})', format='\\1 \\2 \\3 \\4', leading_digits_pattern=['[3489]'])]

View file

@ -0,0 +1,4 @@
"""Auto-generated file, do not edit by hand. 81 metadata"""
from ..phonemetadata import NumberFormat
PHONE_ALT_FORMAT_81 = [NumberFormat(pattern='(\\d{3})(\\d{2})(\\d{4})', format='\\1 \\2 \\3', leading_digits_pattern=['(?:12|57|99)0']), NumberFormat(pattern='(\\d{3})(\\d{2})(\\d{2})(\\d{2})', format='\\1 \\2 \\3 \\4', leading_digits_pattern=['(?:12|57|99)0']), NumberFormat(pattern='(\\d{3})(\\d{4})(\\d{2})', format='\\1 \\2 \\3', leading_digits_pattern=['(?:12|57|99)0'])]

View file

@ -0,0 +1,4 @@
"""Auto-generated file, do not edit by hand. 84 metadata"""
from ..phonemetadata import NumberFormat
PHONE_ALT_FORMAT_84 = [NumberFormat(pattern='(\\d{3})(\\d{3})(\\d{3})', format='\\1 \\2 \\3', leading_digits_pattern=['6']), NumberFormat(pattern='(\\d{2})(\\d{2})(\\d{3})(\\d{3})', format='\\1 \\2 \\3 \\4', leading_digits_pattern=['2[48]']), NumberFormat(pattern='(\\d{4})(\\d{3})(\\d{3})', format='\\1 \\2 \\3', leading_digits_pattern=['1'])]

View file

@ -0,0 +1,4 @@
"""Auto-generated file, do not edit by hand. 855 metadata"""
from ..phonemetadata import NumberFormat
PHONE_ALT_FORMAT_855 = [NumberFormat(pattern='(\\d{2})(\\d{2})(\\d{2})(\\d{2,3})', format='\\1 \\2 \\3 \\4')]

View file

@ -0,0 +1,4 @@
"""Auto-generated file, do not edit by hand. 856 metadata"""
from ..phonemetadata import NumberFormat
PHONE_ALT_FORMAT_856 = [NumberFormat(pattern='(\\d{3})(\\d{3})(\\d{4})', format='\\1 \\2 \\3'), NumberFormat(pattern='(\\d{2})(\\d{4})(\\d{4})', format='\\1 \\2 \\3'), NumberFormat(pattern='(\\d{2})(\\d{8})', format='\\1 \\2')]

View file

@ -0,0 +1,4 @@
"""Auto-generated file, do not edit by hand. 90 metadata"""
from ..phonemetadata import NumberFormat
PHONE_ALT_FORMAT_90 = [NumberFormat(pattern='(\\d{3})(\\d{3})(\\d{4})', format='\\1 \\2 \\3', leading_digits_pattern=['[2-4]|5(?:[02-69]|1[06])']), NumberFormat(pattern='(\\d{3})(\\d{3})(\\d{2})(\\d{2})', format='\\1 \\2 \\3 \\4', leading_digits_pattern=['512|[89]'])]

View file

@ -0,0 +1,4 @@
"""Auto-generated file, do not edit by hand. 91 metadata"""
from ..phonemetadata import NumberFormat
PHONE_ALT_FORMAT_91 = [NumberFormat(pattern='(\\d{2})(\\d{2})(\\d{6})', format='\\1 \\2 \\3', leading_digits_pattern=['6(?:[09]|2(?:[02-7]|8[0-35-9])|5[02-689]|6[024-9]|8[124-9])|7(?:[07]|3[025-9]|4[0-35689]|6(?:[02-9]|1[0-257-9])|8[0-79]|9(?:[089]|31))|8(?:0(?:[01589]|6[67])|1[0-57-9]|2[235-9]|3[03-57-9]|[45]|6[02457-9]|7[1-69]|8(?:[0-25-9]|4[0147-9])|9(?:[02-9]|1[0-27-9]))|9|[67]1[013-9]|(?:67|72)[0235-9]|(?:63|75)[02-46-9]|6(?:29|35)[0-46-9]|(?:64|(?:79|80)7)[02-9]|(?:6(?:[2-4]1|5[17]|6[13]|7[14]|80)|7(?:12|88))[0189]|(?:612|7(?:2[14]|3[134]|4[47]|5[15])|8(?:16|2[014]|3[126]|6[136]|7[078]|83))[017-9]']), NumberFormat(pattern='(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})', format='\\1 \\2 \\3 \\4 \\5', leading_digits_pattern=['6(?:[09]|2(?:[02-7]|8[0-35-9])|5[02-689]|6[024-9]|8[124-9])|7(?:[07]|3[025-9]|4[0-35689]|6(?:[02-9]|1[0-257-9])|8[0-79]|9(?:[089]|31))|8(?:0(?:[01589]|6[67])|1[0-57-9]|2[235-9]|3[03-57-9]|[45]|6[02457-9]|7[1-69]|8(?:[0-25-9]|4[0147-9])|9(?:[02-9]|1[0-27-9]))|9|[67]1[013-9]|(?:67|72)[0235-9]|(?:63|75)[02-46-9]|6(?:29|35)[0-46-9]|(?:64|(?:79|80)7)[02-9]|(?:6(?:[2-4]1|5[17]|6[13]|7[14]|80)|7(?:12|88))[0189]|(?:612|7(?:2[14]|3[134]|4[47]|5[15])|8(?:16|2[014]|3[126]|6[136]|7[078]|83))[017-9]']), NumberFormat(pattern='(\\d{2})(\\d{4})(\\d{4})', format='\\1 \\2 \\3', leading_digits_pattern=['79(?:[089]|31|7[02-9])|80(?:[01589]|6[67]|7[02-9])']), NumberFormat(pattern='(\\d{3})(\\d{3})(\\d{4})', format='\\1 \\2 \\3', leading_digits_pattern=['7(?:1[013-9]|2[0235-9]|3[025-9]|4[0-35689]|5[02-46-9]|6(?:[02-9]|1[0-257-9])|7|8[0-79])|8(?:1[0-57-9]|2[235-9]|3[03-57-9]|[45]|6[02457-9]|7[1-69]|8(?:[0-25-9]|4[0147-9])|9(?:[02-9]|1[0-27-9]))|7(?:12|88)[0189]|(?:7(?:2[14]|3[134]|4[47]|5[15])|8(?:16|2[014]|3[126]|6[136]|7[078]|83))[017-9]']), NumberFormat(pattern='(\\d{4})(\\d{3})(\\d{3})', format='\\1 \\2 \\3', leading_digits_pattern=['7(?:1(?:[013-9]|2[0189])|2[0235-9]|3[025-9]|4[0-35689]|5[02-46-9]|6(?:[02-9]|1[0-257-9])|7)|80(?:[01589]|6[67]|7[02-9])|7(?:2[14]|3[134]|4[47]|5[15])[017-9]'])]

View file

@ -0,0 +1,4 @@
"""Auto-generated file, do not edit by hand. 94 metadata"""
from ..phonemetadata import NumberFormat
PHONE_ALT_FORMAT_94 = [NumberFormat(pattern='(\\d{2})(\\d)(\\d{6})', format='\\1 \\2 \\3', leading_digits_pattern=['[1-689]']), NumberFormat(pattern='(\\d{3})(\\d{6})', format='\\1 \\2', leading_digits_pattern=['[1-689]']), NumberFormat(pattern='(\\d{3})(\\d{3})(\\d{3})', format='\\1 \\2 \\3', leading_digits_pattern=['7'])]

View file

@ -0,0 +1,4 @@
"""Auto-generated file, do not edit by hand. 95 metadata"""
from ..phonemetadata import NumberFormat
PHONE_ALT_FORMAT_95 = [NumberFormat(pattern='(\\d)(\\d{4})(\\d{5})', format='\\1 \\2 \\3', leading_digits_pattern=['92'])]

View file

@ -0,0 +1,4 @@
"""Auto-generated file, do not edit by hand. 971 metadata"""
from ..phonemetadata import NumberFormat
PHONE_ALT_FORMAT_971 = [NumberFormat(pattern='(\\d{2})(\\d{4})(\\d{3})', format='\\1 \\2 \\3', leading_digits_pattern=['5'])]

View file

@ -0,0 +1,4 @@
"""Auto-generated file, do not edit by hand. 972 metadata"""
from ..phonemetadata import NumberFormat
PHONE_ALT_FORMAT_972 = [NumberFormat(pattern='(\\d)(\\d{3})(\\d{2})(\\d{2})', format='\\1 \\2 \\3 \\4', leading_digits_pattern=['[2-489]'])]

View file

@ -0,0 +1,4 @@
"""Auto-generated file, do not edit by hand. 995 metadata"""
from ..phonemetadata import NumberFormat
PHONE_ALT_FORMAT_995 = [NumberFormat(pattern='(\\d{3})(\\d{2})(\\d{2})(\\d{2})', format='\\1 \\2 \\3 \\4', leading_digits_pattern=['32']), NumberFormat(pattern='(\\d{2})(\\d)(\\d{2})(\\d{2})(\\d{2})', format='\\1 \\2 \\3 \\4 \\5', leading_digits_pattern=['32']), NumberFormat(pattern='(\\d{3})(\\d{6})', format='\\1 \\2', leading_digits_pattern=['[348]']), NumberFormat(pattern='(\\d{3})(\\d{3})(\\d{3})', format='\\1 \\2 \\3', leading_digits_pattern=['[348]']), NumberFormat(pattern='(\\d{2})(\\d{2})(\\d{3})(\\d{2})', format='\\1 \\2 \\3 \\4', leading_digits_pattern=['32']), NumberFormat(pattern='(\\d{5})(\\d{2})(\\d{2})', format='\\1 \\2 \\3', leading_digits_pattern=['32'])]

View file

@ -0,0 +1,7 @@
"""Auto-generated file, do not edit by hand. 800 metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_800 = PhoneMetadata(id='001', country_code=800, international_prefix=None,
general_desc=PhoneNumberDesc(national_number_pattern='(?:00|[1-9]\\d)\\d{6}', possible_length=(8,)),
toll_free=PhoneNumberDesc(national_number_pattern='(?:00|[1-9]\\d)\\d{6}', example_number='12345678', possible_length=(8,)),
number_format=[NumberFormat(pattern='(\\d{4})(\\d{4})', format='\\1 \\2', leading_digits_pattern=['\\d'])])

View file

@ -0,0 +1,7 @@
"""Auto-generated file, do not edit by hand. 808 metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_808 = PhoneMetadata(id='001', country_code=808, international_prefix=None,
general_desc=PhoneNumberDesc(national_number_pattern='[1-9]\\d{7}', possible_length=(8,)),
shared_cost=PhoneNumberDesc(national_number_pattern='[1-9]\\d{7}', example_number='12345678', possible_length=(8,)),
number_format=[NumberFormat(pattern='(\\d{4})(\\d{4})', format='\\1 \\2', leading_digits_pattern=['[1-9]'])])

View file

@ -0,0 +1,7 @@
"""Auto-generated file, do not edit by hand. 870 metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_870 = PhoneMetadata(id='001', country_code=870, international_prefix=None,
general_desc=PhoneNumberDesc(national_number_pattern='7\\d{11}|[35-7]\\d{8}', possible_length=(9, 12)),
mobile=PhoneNumberDesc(national_number_pattern='(?:[356]|774[45])\\d{8}|7[6-8]\\d{7}', example_number='301234567', possible_length=(9, 12)),
number_format=[NumberFormat(pattern='(\\d{3})(\\d{3})(\\d{3})', format='\\1 \\2 \\3', leading_digits_pattern=['[35-7]'])])

View file

@ -0,0 +1,7 @@
"""Auto-generated file, do not edit by hand. 878 metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_878 = PhoneMetadata(id='001', country_code=878, international_prefix=None,
general_desc=PhoneNumberDesc(national_number_pattern='10\\d{10}', possible_length=(12,)),
voip=PhoneNumberDesc(national_number_pattern='10\\d{10}', example_number='101234567890', possible_length=(12,)),
number_format=[NumberFormat(pattern='(\\d{2})(\\d{5})(\\d{5})', format='\\1 \\2 \\3', leading_digits_pattern=['1'])])

View file

@ -0,0 +1,8 @@
"""Auto-generated file, do not edit by hand. 881 metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_881 = PhoneMetadata(id='001', country_code=881, international_prefix=None,
general_desc=PhoneNumberDesc(national_number_pattern='6\\d{9}|[0-36-9]\\d{8}', possible_length=(9, 10)),
mobile=PhoneNumberDesc(national_number_pattern='6\\d{9}|[0-36-9]\\d{8}', example_number='612345678', possible_length=(9, 10)),
number_format=[NumberFormat(pattern='(\\d)(\\d{3})(\\d{5})', format='\\1 \\2 \\3', leading_digits_pattern=['[0-37-9]']),
NumberFormat(pattern='(\\d)(\\d{3})(\\d{5,6})', format='\\1 \\2 \\3', leading_digits_pattern=['6'])])

View file

@ -0,0 +1,16 @@
"""Auto-generated file, do not edit by hand. 882 metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_882 = PhoneMetadata(id='001', country_code=882, international_prefix=None,
general_desc=PhoneNumberDesc(national_number_pattern='[13]\\d{6}(?:\\d{2,5})?|[19]\\d{7}|(?:[25]\\d\\d|4)\\d{7}(?:\\d{2})?', possible_length=(7, 8, 9, 10, 11, 12)),
mobile=PhoneNumberDesc(national_number_pattern='342\\d{4}|(?:337|49)\\d{6}|(?:3(?:2|47|7\\d{3})|50\\d{3})\\d{7}', example_number='3421234', possible_length=(7, 8, 9, 10, 12)),
voip=PhoneNumberDesc(national_number_pattern='1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15-8]|9[0689])\\d{4}|6\\d{5,10})|(?:345\\d|9[89])\\d{6}|(?:10|2(?:3|85\\d)|3(?:[15]|[69]\\d\\d)|4[15-8]|51)\\d{8}', example_number='390123456789', possible_length=(7, 8, 9, 10, 11, 12)),
voicemail=PhoneNumberDesc(national_number_pattern='348[57]\\d{7}', example_number='34851234567', possible_length=(11,)),
number_format=[NumberFormat(pattern='(\\d{2})(\\d{5})', format='\\1 \\2', leading_digits_pattern=['16|342']),
NumberFormat(pattern='(\\d{2})(\\d{6})', format='\\1 \\2', leading_digits_pattern=['49']),
NumberFormat(pattern='(\\d{2})(\\d{2})(\\d{4})', format='\\1 \\2 \\3', leading_digits_pattern=['1[36]|9']),
NumberFormat(pattern='(\\d{2})(\\d{4})(\\d{3})', format='\\1 \\2 \\3', leading_digits_pattern=['3[23]']),
NumberFormat(pattern='(\\d{2})(\\d{3,4})(\\d{4})', format='\\1 \\2 \\3', leading_digits_pattern=['16']),
NumberFormat(pattern='(\\d{2})(\\d{4})(\\d{4})', format='\\1 \\2 \\3', leading_digits_pattern=['10|23|3(?:[15]|4[57])|4|51']),
NumberFormat(pattern='(\\d{3})(\\d{4})(\\d{4})', format='\\1 \\2 \\3', leading_digits_pattern=['34']),
NumberFormat(pattern='(\\d{2})(\\d{4,5})(\\d{5})', format='\\1 \\2 \\3', leading_digits_pattern=['[1-35]'])])

View file

@ -0,0 +1,11 @@
"""Auto-generated file, do not edit by hand. 883 metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_883 = PhoneMetadata(id='001', country_code=883, international_prefix=None,
general_desc=PhoneNumberDesc(national_number_pattern='(?:[1-4]\\d|51)\\d{6,10}', possible_length=(8, 9, 10, 11, 12)),
voip=PhoneNumberDesc(national_number_pattern='(?:2(?:00\\d\\d|10)|(?:370[1-9]|51\\d0)\\d)\\d{7}|51(?:00\\d{5}|[24-9]0\\d{4,7})|(?:1[0-79]|2[24-689]|3[02-689]|4[0-4])0\\d{5,9}', example_number='510012345', possible_length=(8, 9, 10, 11, 12)),
number_format=[NumberFormat(pattern='(\\d{3})(\\d{3})(\\d{2,8})', format='\\1 \\2 \\3', leading_digits_pattern=['[14]|2[24-689]|3[02-689]|51[24-9]']),
NumberFormat(pattern='(\\d{3})(\\d{3})(\\d{3})', format='\\1 \\2 \\3', leading_digits_pattern=['510']),
NumberFormat(pattern='(\\d{3})(\\d{3})(\\d{4})', format='\\1 \\2 \\3', leading_digits_pattern=['21']),
NumberFormat(pattern='(\\d{4})(\\d{4})(\\d{4})', format='\\1 \\2 \\3', leading_digits_pattern=['51[13]']),
NumberFormat(pattern='(\\d{3})(\\d{3})(\\d{3})(\\d{3})', format='\\1 \\2 \\3 \\4', leading_digits_pattern=['[235]'])])

View file

@ -0,0 +1,7 @@
"""Auto-generated file, do not edit by hand. 888 metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_888 = PhoneMetadata(id='001', country_code=888, international_prefix=None,
general_desc=PhoneNumberDesc(national_number_pattern='\\d{11}', possible_length=(11,)),
uan=PhoneNumberDesc(national_number_pattern='\\d{11}', example_number='12345678901', possible_length=(11,)),
number_format=[NumberFormat(pattern='(\\d{3})(\\d{3})(\\d{5})', format='\\1 \\2 \\3')])

View file

@ -0,0 +1,7 @@
"""Auto-generated file, do not edit by hand. 979 metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_979 = PhoneMetadata(id='001', country_code=979, international_prefix=None,
general_desc=PhoneNumberDesc(national_number_pattern='[1359]\\d{8}', possible_length=(9,), possible_length_local_only=(8,)),
premium_rate=PhoneNumberDesc(national_number_pattern='[1359]\\d{8}', example_number='123456789', possible_length=(9,), possible_length_local_only=(8,)),
number_format=[NumberFormat(pattern='(\\d)(\\d{4})(\\d{4})', format='\\1 \\2 \\3', leading_digits_pattern=['[1359]'])])

View file

@ -0,0 +1,8 @@
"""Auto-generated file, do not edit by hand. AC metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_AC = PhoneMetadata(id='AC', country_code=247, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='(?:[01589]\\d|[46])\\d{4}', possible_length=(5, 6)),
fixed_line=PhoneNumberDesc(national_number_pattern='6[2-467]\\d{3}', example_number='62889', possible_length=(5,)),
mobile=PhoneNumberDesc(national_number_pattern='4\\d{4}', example_number='40123', possible_length=(5,)),
uan=PhoneNumberDesc(national_number_pattern='(?:0[1-9]|[1589]\\d)\\d{4}', example_number='542011', possible_length=(6,)))

View file

@ -0,0 +1,13 @@
"""Auto-generated file, do not edit by hand. AD metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_AD = PhoneMetadata(id='AD', country_code=376, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='(?:1|6\\d)\\d{7}|[135-9]\\d{5}', possible_length=(6, 8, 9)),
fixed_line=PhoneNumberDesc(national_number_pattern='[78]\\d{5}', example_number='712345', possible_length=(6,)),
mobile=PhoneNumberDesc(national_number_pattern='690\\d{6}|[356]\\d{5}', example_number='312345', possible_length=(6, 9)),
toll_free=PhoneNumberDesc(national_number_pattern='180[02]\\d{4}', example_number='18001234', possible_length=(8,)),
premium_rate=PhoneNumberDesc(national_number_pattern='[19]\\d{5}', example_number='912345', possible_length=(6,)),
no_international_dialling=PhoneNumberDesc(national_number_pattern='1800\\d{4}', possible_length=(8,)),
number_format=[NumberFormat(pattern='(\\d{3})(\\d{3})', format='\\1 \\2', leading_digits_pattern=['[135-9]']),
NumberFormat(pattern='(\\d{4})(\\d{4})', format='\\1 \\2', leading_digits_pattern=['1']),
NumberFormat(pattern='(\\d{3})(\\d{3})(\\d{3})', format='\\1 \\2 \\3', leading_digits_pattern=['6'])])

View file

@ -0,0 +1,17 @@
"""Auto-generated file, do not edit by hand. AE metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_AE = PhoneMetadata(id='AE', country_code=971, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='(?:[4-7]\\d|9[0-689])\\d{7}|800\\d{2,9}|[2-4679]\\d{7}', possible_length=(5, 6, 7, 8, 9, 10, 11, 12)),
fixed_line=PhoneNumberDesc(national_number_pattern='[2-4679][2-8]\\d{6}', example_number='22345678', possible_length=(8,), possible_length_local_only=(7,)),
mobile=PhoneNumberDesc(national_number_pattern='5[024-68]\\d{7}', example_number='501234567', possible_length=(9,)),
toll_free=PhoneNumberDesc(national_number_pattern='400\\d{6}|800\\d{2,9}', example_number='800123456', possible_length=(5, 6, 7, 8, 9, 10, 11, 12)),
premium_rate=PhoneNumberDesc(national_number_pattern='900[02]\\d{5}', example_number='900234567', possible_length=(9,)),
shared_cost=PhoneNumberDesc(national_number_pattern='700[05]\\d{5}', example_number='700012345', possible_length=(9,)),
uan=PhoneNumberDesc(national_number_pattern='600[25]\\d{5}', example_number='600212345', possible_length=(9,)),
national_prefix='0',
national_prefix_for_parsing='0',
number_format=[NumberFormat(pattern='(\\d{3})(\\d{2,9})', format='\\1 \\2', leading_digits_pattern=['60|8']),
NumberFormat(pattern='(\\d)(\\d{3})(\\d{4})', format='\\1 \\2 \\3', leading_digits_pattern=['[236]|[479][2-8]'], national_prefix_formatting_rule='0\\1'),
NumberFormat(pattern='(\\d{3})(\\d)(\\d{5})', format='\\1 \\2 \\3', leading_digits_pattern=['[479]']),
NumberFormat(pattern='(\\d{2})(\\d{3})(\\d{4})', format='\\1 \\2 \\3', leading_digits_pattern=['5'], national_prefix_formatting_rule='0\\1')])

View file

@ -0,0 +1,12 @@
"""Auto-generated file, do not edit by hand. AF metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_AF = PhoneMetadata(id='AF', country_code=93, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[2-7]\\d{8}', possible_length=(9,), possible_length_local_only=(7,)),
fixed_line=PhoneNumberDesc(national_number_pattern='(?:[25][0-8]|[34][0-4]|6[0-5])[2-9]\\d{6}', example_number='234567890', possible_length=(9,), possible_length_local_only=(7,)),
mobile=PhoneNumberDesc(national_number_pattern='7\\d{8}', example_number='701234567', possible_length=(9,), possible_length_local_only=(7,)),
national_prefix='0',
national_prefix_for_parsing='0',
number_format=[NumberFormat(pattern='(\\d{3})(\\d{4})', format='\\1 \\2', leading_digits_pattern=['[1-9]']),
NumberFormat(pattern='(\\d{2})(\\d{3})(\\d{4})', format='\\1 \\2 \\3', leading_digits_pattern=['[2-7]'], national_prefix_formatting_rule='0\\1')],
intl_number_format=[NumberFormat(pattern='(\\d{2})(\\d{3})(\\d{4})', format='\\1 \\2 \\3', leading_digits_pattern=['[2-7]'])])

View file

@ -0,0 +1,17 @@
"""Auto-generated file, do not edit by hand. AG metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_AG = PhoneMetadata(id='AG', country_code=1, international_prefix='011',
general_desc=PhoneNumberDesc(national_number_pattern='(?:268|[58]\\d\\d|900)\\d{7}', possible_length=(10,), possible_length_local_only=(7,)),
fixed_line=PhoneNumberDesc(national_number_pattern='268(?:4(?:6[0-38]|84)|56[0-2])\\d{4}', example_number='2684601234', possible_length=(10,), possible_length_local_only=(7,)),
mobile=PhoneNumberDesc(national_number_pattern='268(?:464|7(?:1[3-9]|[28]\\d|3[0246]|64|7[0-689]))\\d{4}', example_number='2684641234', possible_length=(10,), possible_length_local_only=(7,)),
toll_free=PhoneNumberDesc(national_number_pattern='8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', example_number='8002123456', possible_length=(10,)),
premium_rate=PhoneNumberDesc(national_number_pattern='900[2-9]\\d{6}', example_number='9002123456', possible_length=(10,)),
personal_number=PhoneNumberDesc(national_number_pattern='52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}', example_number='5002345678', possible_length=(10,)),
voip=PhoneNumberDesc(national_number_pattern='26848[01]\\d{4}', example_number='2684801234', possible_length=(10,), possible_length_local_only=(7,)),
pager=PhoneNumberDesc(national_number_pattern='26840[69]\\d{4}', example_number='2684061234', possible_length=(10,), possible_length_local_only=(7,)),
national_prefix='1',
national_prefix_for_parsing='([457]\\d{6})$|1',
national_prefix_transform_rule='268\\1',
leading_digits='268',
mobile_number_portable_region=True)

View file

@ -0,0 +1,16 @@
"""Auto-generated file, do not edit by hand. AI metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_AI = PhoneMetadata(id='AI', country_code=1, international_prefix='011',
general_desc=PhoneNumberDesc(national_number_pattern='(?:264|[58]\\d\\d|900)\\d{7}', possible_length=(10,), possible_length_local_only=(7,)),
fixed_line=PhoneNumberDesc(national_number_pattern='264(?:292|4(?:6[12]|9[78]))\\d{4}', example_number='2644612345', possible_length=(10,), possible_length_local_only=(7,)),
mobile=PhoneNumberDesc(national_number_pattern='264(?:235|4(?:69|76)|5(?:3[6-9]|8[1-4])|7(?:29|72))\\d{4}', example_number='2642351234', possible_length=(10,), possible_length_local_only=(7,)),
toll_free=PhoneNumberDesc(national_number_pattern='8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', example_number='8002123456', possible_length=(10,)),
premium_rate=PhoneNumberDesc(national_number_pattern='900[2-9]\\d{6}', example_number='9002123456', possible_length=(10,)),
personal_number=PhoneNumberDesc(national_number_pattern='52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}', example_number='5002345678', possible_length=(10,)),
pager=PhoneNumberDesc(national_number_pattern='264724\\d{4}', example_number='2647241234', possible_length=(10,), possible_length_local_only=(7,)),
national_prefix='1',
national_prefix_for_parsing='([2457]\\d{6})$|1',
national_prefix_transform_rule='264\\1',
leading_digits='264',
mobile_number_portable_region=True)

View file

@ -0,0 +1,19 @@
"""Auto-generated file, do not edit by hand. AL metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_AL = PhoneMetadata(id='AL', country_code=355, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='(?:700\\d\\d|900)\\d{3}|8\\d{5,7}|(?:[2-5]|6\\d)\\d{7}', possible_length=(6, 7, 8, 9), possible_length_local_only=(5,)),
fixed_line=PhoneNumberDesc(national_number_pattern='4505[0-2]\\d{3}|(?:[2358][16-9]\\d[2-9]|4410)\\d{4}|(?:[2358][2-5][2-9]|4(?:[2-57-9][2-9]|6\\d))\\d{5}', example_number='22345678', possible_length=(8,), possible_length_local_only=(5, 6, 7)),
mobile=PhoneNumberDesc(national_number_pattern='6(?:[78][2-9]|9\\d)\\d{6}', example_number='672123456', possible_length=(9,)),
toll_free=PhoneNumberDesc(national_number_pattern='800\\d{4}', example_number='8001234', possible_length=(7,)),
premium_rate=PhoneNumberDesc(national_number_pattern='900[1-9]\\d\\d', example_number='900123', possible_length=(6,)),
shared_cost=PhoneNumberDesc(national_number_pattern='808[1-9]\\d\\d', example_number='808123', possible_length=(6,)),
personal_number=PhoneNumberDesc(national_number_pattern='700[2-9]\\d{4}', example_number='70021234', possible_length=(8,)),
national_prefix='0',
national_prefix_for_parsing='0',
number_format=[NumberFormat(pattern='(\\d{3})(\\d{3,4})', format='\\1 \\2', leading_digits_pattern=['80|9'], national_prefix_formatting_rule='0\\1'),
NumberFormat(pattern='(\\d)(\\d{3})(\\d{4})', format='\\1 \\2 \\3', leading_digits_pattern=['4[2-6]'], national_prefix_formatting_rule='0\\1'),
NumberFormat(pattern='(\\d{2})(\\d{3})(\\d{3})', format='\\1 \\2 \\3', leading_digits_pattern=['[2358][2-5]|4'], national_prefix_formatting_rule='0\\1'),
NumberFormat(pattern='(\\d{3})(\\d{5})', format='\\1 \\2', leading_digits_pattern=['[23578]'], national_prefix_formatting_rule='0\\1'),
NumberFormat(pattern='(\\d{2})(\\d{3})(\\d{4})', format='\\1 \\2 \\3', leading_digits_pattern=['6'], national_prefix_formatting_rule='0\\1')],
mobile_number_portable_region=True)

View file

@ -0,0 +1,18 @@
"""Auto-generated file, do not edit by hand. AM metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_AM = PhoneMetadata(id='AM', country_code=374, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='(?:[1-489]\\d|55|60|77)\\d{6}', possible_length=(8,), possible_length_local_only=(5, 6)),
fixed_line=PhoneNumberDesc(national_number_pattern='(?:(?:1[0-25]|47)\\d|2(?:2[2-46]|3[1-8]|4[2-69]|5[2-7]|6[1-9]|8[1-7])|3[12]2)\\d{5}', example_number='10123456', possible_length=(8,), possible_length_local_only=(5, 6)),
mobile=PhoneNumberDesc(national_number_pattern='(?:33|4[1349]|55|77|88|9[13-9])\\d{6}', example_number='77123456', possible_length=(8,)),
toll_free=PhoneNumberDesc(national_number_pattern='800\\d{5}', example_number='80012345', possible_length=(8,)),
premium_rate=PhoneNumberDesc(national_number_pattern='90[016]\\d{5}', example_number='90012345', possible_length=(8,)),
shared_cost=PhoneNumberDesc(national_number_pattern='80[1-4]\\d{5}', example_number='80112345', possible_length=(8,)),
voip=PhoneNumberDesc(national_number_pattern='60(?:2[78]|3[5-9]|4[02-9]|5[0-46-9]|[6-8]\\d|9[0-2])\\d{4}', example_number='60271234', possible_length=(8,)),
national_prefix='0',
national_prefix_for_parsing='0',
number_format=[NumberFormat(pattern='(\\d{3})(\\d{2})(\\d{3})', format='\\1 \\2 \\3', leading_digits_pattern=['[89]0'], national_prefix_formatting_rule='0 \\1'),
NumberFormat(pattern='(\\d{3})(\\d{5})', format='\\1 \\2', leading_digits_pattern=['2|3[12]'], national_prefix_formatting_rule='(0\\1)'),
NumberFormat(pattern='(\\d{2})(\\d{6})', format='\\1 \\2', leading_digits_pattern=['1|47'], national_prefix_formatting_rule='(0\\1)'),
NumberFormat(pattern='(\\d{2})(\\d{6})', format='\\1 \\2', leading_digits_pattern=['[3-9]'], national_prefix_formatting_rule='0\\1')],
mobile_number_portable_region=True)

View file

@ -0,0 +1,8 @@
"""Auto-generated file, do not edit by hand. AO metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_AO = PhoneMetadata(id='AO', country_code=244, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[29]\\d{8}', possible_length=(9,)),
fixed_line=PhoneNumberDesc(national_number_pattern='2\\d(?:[0134][25-9]|[25-9]\\d)\\d{5}', example_number='222123456', possible_length=(9,)),
mobile=PhoneNumberDesc(national_number_pattern='9[1-59]\\d{7}', example_number='923123456', possible_length=(9,)),
number_format=[NumberFormat(pattern='(\\d{3})(\\d{3})(\\d{3})', format='\\1 \\2 \\3', leading_digits_pattern=['[29]'])])

View file

@ -0,0 +1,35 @@
"""Auto-generated file, do not edit by hand. AR metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_AR = PhoneMetadata(id='AR', country_code=54, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='(?:11|[89]\\d\\d)\\d{8}|[2368]\\d{9}', possible_length=(10, 11), possible_length_local_only=(6, 7, 8)),
fixed_line=PhoneNumberDesc(national_number_pattern='3888[013-9]\\d{5}|3(?:7(?:1[15]|81)|8(?:21|4[16]|69|9[12]))[46]\\d{5}|(?:2(?:657|9(?:54|66))|3(?:7(?:55|77)|865))[2-8]\\d{5}|(?:2(?:2(?:2[59]|44|52)|3(?:26|44)|473|9(?:[07]2|2[26]|34|46))|3327)[45]\\d{5}|(?:2(?:284|3(?:02|23)|920)|3(?:4(?:46|8[27]|92)|541|878))[2-7]\\d{5}|(?:2(?:(?:26|62)2|320|477|9(?:42|83))|3(?:329|4(?:62|76|89)|564))[2-6]\\d{5}|(?:(?:11[1-8]|670)\\d|2(?:2(?:0[45]|1[2-6]|3[3-6])|3(?:[06]4|7[45])|494|6(?:04|1[2-8]|[36][45]|4[3-6])|80[45]|9(?:[17][4-6]|[48][45]|9[3-6]))|3(?:364|4(?:1[2-8]|[235][4-6]|84)|5(?:1[2-9]|[38][4-6])|6(?:2[45]|44)|7[069][45]|8(?:0[45]|[17][2-6]|3[4-6]|[58][3-6])))\\d{6}|2(?:2(?:21|4[23]|6[145]|7[1-4]|8[356]|9[267])|3(?:16|3[13-8]|43|5[346-8]|9[3-5])|475|6(?:2[46]|4[78]|5[1568])|9(?:03|2[1457-9]|3[1356]|4[08]|[56][23]|82))4\\d{5}|(?:2(?:2(?:57|81)|3(?:24|46|92)|9(?:01|23|64))|3(?:4(?:42|71)|5(?:25|37|4[347]|71)|7(?:18|5[17])))[3-6]\\d{5}|(?:2(?:2(?:02|2[3467]|4[156]|5[45]|6[6-8]|91)|3(?:1[47]|25|[45][25]|96)|47[48]|625|932)|3(?:38[2578]|4(?:0[0-24-9]|3[78]|4[457]|58|6[03-9]|72|83|9[136-8])|5(?:2[124]|[368][23]|4[2689]|7[2-6])|7(?:16|2[15]|3[145]|4[13]|5[468]|7[2-5]|8[26])|8(?:2[5-7]|3[278]|4[3-5]|5[78]|6[1-378]|[78]7|94)))[4-6]\\d{5}', example_number='1123456789', possible_length=(10,), possible_length_local_only=(6, 7, 8)),
mobile=PhoneNumberDesc(national_number_pattern='93(?:7(?:1[15]|81)[46]|8(?:(?:21|4[16]|69|9[12])[46]|88[013-9]))\\d{5}|9(?:2(?:657|9(?:54|66))|3(?:7(?:55|77)|865))[2-8]\\d{5}|9(?:2(?:2(?:2[59]|44|52)|3(?:26|44)|473|9(?:[07]2|2[26]|34|46))|3327)[45]\\d{5}|9(?:2(?:284|3(?:02|23)|920)|3(?:4(?:46|8[27]|92)|541|878))[2-7]\\d{5}|9(?:2(?:(?:26|62)2|320|477|9(?:42|83))|3(?:329|4(?:62|76|89)|564))[2-6]\\d{5}|(?:675\\d|9(?:11[1-8]\\d|2(?:2(?:0[45]|1[2-6]|3[3-6])|3(?:[06]4|7[45])|494|6(?:04|1[2-8]|[36][45]|4[3-6])|80[45]|9(?:[17][4-6]|[48][45]|9[3-6]))|3(?:364|4(?:1[2-8]|[235][4-6]|84)|5(?:1[2-9]|[38][4-6])|6(?:2[45]|44)|7[069][45]|8(?:0[45]|[17][2-6]|3[4-6]|[58][3-6]))))\\d{6}|92(?:2(?:21|4[23]|6[145]|7[1-4]|8[356]|9[267])|3(?:16|3[13-8]|43|5[346-8]|9[3-5])|475|6(?:2[46]|4[78]|5[1568])|9(?:03|2[1457-9]|3[1356]|4[08]|[56][23]|82))4\\d{5}|9(?:2(?:2(?:57|81)|3(?:24|46|92)|9(?:01|23|64))|3(?:4(?:42|71)|5(?:25|37|4[347]|71)|7(?:18|5[17])))[3-6]\\d{5}|9(?:2(?:2(?:02|2[3467]|4[156]|5[45]|6[6-8]|91)|3(?:1[47]|25|[45][25]|96)|47[48]|625|932)|3(?:38[2578]|4(?:0[0-24-9]|3[78]|4[457]|58|6[03-9]|72|83|9[136-8])|5(?:2[124]|[368][23]|4[2689]|7[2-6])|7(?:16|2[15]|3[145]|4[13]|5[468]|7[2-5]|8[26])|8(?:2[5-7]|3[278]|4[3-5]|5[78]|6[1-378]|[78]7|94)))[4-6]\\d{5}', example_number='91123456789', possible_length=(10, 11), possible_length_local_only=(6, 7, 8)),
toll_free=PhoneNumberDesc(national_number_pattern='800\\d{7,8}', example_number='8001234567', possible_length=(10, 11)),
premium_rate=PhoneNumberDesc(national_number_pattern='60[04579]\\d{7}', example_number='6001234567', possible_length=(10,)),
uan=PhoneNumberDesc(national_number_pattern='810\\d{7}', example_number='8101234567', possible_length=(10,)),
no_international_dialling=PhoneNumberDesc(national_number_pattern='810\\d{7}', possible_length=(10,)),
national_prefix='0',
national_prefix_for_parsing='0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[0-24-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-46-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:[069]|1[1568]|2[15]|3[145]|4[13]|5[14-8]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))15)?',
national_prefix_transform_rule='9\\1',
number_format=[NumberFormat(pattern='(\\d{3})', format='\\1', leading_digits_pattern=['0|1(?:0[0-35-7]|1[02-5]|2[015]|3[47]|4[478])|911']),
NumberFormat(pattern='(\\d{2})(\\d{4})', format='\\1-\\2', leading_digits_pattern=['[1-9]']),
NumberFormat(pattern='(\\d{3})(\\d{4})', format='\\1-\\2', leading_digits_pattern=['[2-9]']),
NumberFormat(pattern='(\\d{4})(\\d{4})', format='\\1-\\2', leading_digits_pattern=['[1-8]']),
NumberFormat(pattern='(\\d{4})(\\d{2})(\\d{4})', format='\\1 \\2-\\3', leading_digits_pattern=['2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])', '2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)', '2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]', '2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]'], national_prefix_formatting_rule='0\\1', national_prefix_optional_when_formatting=True),
NumberFormat(pattern='(\\d{2})(\\d{4})(\\d{4})', format='\\1 \\2-\\3', leading_digits_pattern=['1'], national_prefix_formatting_rule='0\\1', national_prefix_optional_when_formatting=True),
NumberFormat(pattern='(\\d{3})(\\d{3})(\\d{4})', format='\\1-\\2-\\3', leading_digits_pattern=['[68]'], national_prefix_formatting_rule='0\\1'),
NumberFormat(pattern='(\\d{3})(\\d{3})(\\d{4})', format='\\1 \\2-\\3', leading_digits_pattern=['[23]'], national_prefix_formatting_rule='0\\1', national_prefix_optional_when_formatting=True),
NumberFormat(pattern='(\\d)(\\d{4})(\\d{2})(\\d{4})', format='\\2 15-\\3-\\4', leading_digits_pattern=['9(?:2[2-469]|3[3-578])', '9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))', '9(?:2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(?:2[24-9]|3[1-59]|47)', '9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5(?:[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]', '9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|5(?:4(?:4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]'], national_prefix_formatting_rule='0\\1'),
NumberFormat(pattern='(\\d)(\\d{2})(\\d{4})(\\d{4})', format='\\2 15-\\3-\\4', leading_digits_pattern=['91'], national_prefix_formatting_rule='0\\1'),
NumberFormat(pattern='(\\d{3})(\\d{3})(\\d{5})', format='\\1-\\2-\\3', leading_digits_pattern=['8'], national_prefix_formatting_rule='0\\1'),
NumberFormat(pattern='(\\d)(\\d{3})(\\d{3})(\\d{4})', format='\\2 15-\\3-\\4', leading_digits_pattern=['9'], national_prefix_formatting_rule='0\\1')],
intl_number_format=[NumberFormat(pattern='(\\d{4})(\\d{2})(\\d{4})', format='\\1 \\2-\\3', leading_digits_pattern=['2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])', '2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)', '2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]', '2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]']),
NumberFormat(pattern='(\\d{2})(\\d{4})(\\d{4})', format='\\1 \\2-\\3', leading_digits_pattern=['1']),
NumberFormat(pattern='(\\d{3})(\\d{3})(\\d{4})', format='\\1-\\2-\\3', leading_digits_pattern=['[68]']),
NumberFormat(pattern='(\\d{3})(\\d{3})(\\d{4})', format='\\1 \\2-\\3', leading_digits_pattern=['[23]']),
NumberFormat(pattern='(\\d)(\\d{4})(\\d{2})(\\d{4})', format='\\1 \\2 \\3-\\4', leading_digits_pattern=['9(?:2[2-469]|3[3-578])', '9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))', '9(?:2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(?:2[24-9]|3[1-59]|47)', '9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5(?:[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]', '9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|5(?:4(?:4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]']),
NumberFormat(pattern='(\\d)(\\d{2})(\\d{4})(\\d{4})', format='\\1 \\2 \\3-\\4', leading_digits_pattern=['91']),
NumberFormat(pattern='(\\d{3})(\\d{3})(\\d{5})', format='\\1-\\2-\\3', leading_digits_pattern=['8']),
NumberFormat(pattern='(\\d)(\\d{3})(\\d{3})(\\d{4})', format='\\1 \\2 \\3-\\4', leading_digits_pattern=['9'])],
mobile_number_portable_region=True)

View file

@ -0,0 +1,14 @@
"""Auto-generated file, do not edit by hand. AS metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_AS = PhoneMetadata(id='AS', country_code=1, international_prefix='011',
general_desc=PhoneNumberDesc(national_number_pattern='(?:[58]\\d\\d|684|900)\\d{7}', possible_length=(10,), possible_length_local_only=(7,)),
fixed_line=PhoneNumberDesc(national_number_pattern='6846(?:22|33|44|55|77|88|9[19])\\d{4}', example_number='6846221234', possible_length=(10,), possible_length_local_only=(7,)),
mobile=PhoneNumberDesc(national_number_pattern='684(?:2(?:48|5[2468]|7[26])|7(?:3[13]|70|82))\\d{4}', example_number='6847331234', possible_length=(10,), possible_length_local_only=(7,)),
toll_free=PhoneNumberDesc(national_number_pattern='8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', example_number='8002123456', possible_length=(10,)),
premium_rate=PhoneNumberDesc(national_number_pattern='900[2-9]\\d{6}', example_number='9002123456', possible_length=(10,)),
personal_number=PhoneNumberDesc(national_number_pattern='52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}', example_number='5002345678', possible_length=(10,)),
national_prefix='1',
national_prefix_for_parsing='([267]\\d{6})$|1',
national_prefix_transform_rule='684\\1',
leading_digits='684')

View file

@ -0,0 +1,30 @@
"""Auto-generated file, do not edit by hand. AT metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_AT = PhoneMetadata(id='AT', country_code=43, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='1\\d{3,12}|2\\d{6,12}|43(?:(?:0\\d|5[02-9])\\d{3,9}|2\\d{4,5}|[3467]\\d{4}|8\\d{4,6}|9\\d{4,7})|5\\d{4,12}|8\\d{7,12}|9\\d{8,12}|(?:[367]\\d|4[0-24-9])\\d{4,11}', possible_length=(4, 5, 6, 7, 8, 9, 10, 11, 12, 13), possible_length_local_only=(3,)),
fixed_line=PhoneNumberDesc(national_number_pattern='1(?:11\\d|[2-9]\\d{3,11})|(?:316|463|(?:51|66|73)2)\\d{3,10}|(?:2(?:1[467]|2[13-8]|5[2357]|6[1-46-8]|7[1-8]|8[124-7]|9[1458])|3(?:1[1-578]|3[23568]|4[5-7]|5[1378]|6[1-38]|8[3-68])|4(?:2[1-8]|35|7[1368]|8[2457])|5(?:2[1-8]|3[357]|4[147]|5[12578]|6[37])|6(?:13|2[1-47]|4[135-8]|5[468])|7(?:2[1-8]|35|4[13478]|5[68]|6[16-8]|7[1-6]|9[45]))\\d{4,10}', example_number='1234567890', possible_length=(4, 5, 6, 7, 8, 9, 10, 11, 12, 13), possible_length_local_only=(3,)),
mobile=PhoneNumberDesc(national_number_pattern='6(?:5[0-3579]|6[013-9]|[7-9]\\d)\\d{4,10}', example_number='664123456', possible_length=(7, 8, 9, 10, 11, 12, 13)),
toll_free=PhoneNumberDesc(national_number_pattern='800\\d{6,10}', example_number='800123456', possible_length=(9, 10, 11, 12, 13)),
premium_rate=PhoneNumberDesc(national_number_pattern='(?:8[69][2-68]|9(?:0[01]|3[019]))\\d{6,10}', example_number='900123456', possible_length=(9, 10, 11, 12, 13)),
shared_cost=PhoneNumberDesc(national_number_pattern='8(?:10|2[018])\\d{6,10}|828\\d{5}', example_number='810123456', possible_length=(8, 9, 10, 11, 12, 13)),
voip=PhoneNumberDesc(national_number_pattern='5(?:0[1-9]|17|[79]\\d)\\d{2,10}|7[28]0\\d{6,10}', example_number='780123456', possible_length=(5, 6, 7, 8, 9, 10, 11, 12, 13)),
national_prefix='0',
national_prefix_for_parsing='0',
number_format=[NumberFormat(pattern='(\\d{4})', format='\\1', leading_digits_pattern=['14']),
NumberFormat(pattern='(\\d)(\\d{3,12})', format='\\1 \\2', leading_digits_pattern=['1(?:11|[2-9])'], national_prefix_formatting_rule='0\\1'),
NumberFormat(pattern='(\\d{3})(\\d{2})', format='\\1 \\2', leading_digits_pattern=['517'], national_prefix_formatting_rule='0\\1'),
NumberFormat(pattern='(\\d{2})(\\d{3,5})', format='\\1 \\2', leading_digits_pattern=['5[079]'], national_prefix_formatting_rule='0\\1'),
NumberFormat(pattern='(\\d{6})', format='\\1', leading_digits_pattern=['[18]']),
NumberFormat(pattern='(\\d{3})(\\d{3,10})', format='\\1 \\2', leading_digits_pattern=['(?:31|4)6|51|6(?:5[0-3579]|[6-9])|7(?:20|32|8)|[89]'], national_prefix_formatting_rule='0\\1'),
NumberFormat(pattern='(\\d{4})(\\d{3,9})', format='\\1 \\2', leading_digits_pattern=['[2-467]|5[2-6]'], national_prefix_formatting_rule='0\\1'),
NumberFormat(pattern='(\\d{2})(\\d{3})(\\d{3,4})', format='\\1 \\2 \\3', leading_digits_pattern=['5'], national_prefix_formatting_rule='0\\1'),
NumberFormat(pattern='(\\d{2})(\\d{4})(\\d{4,7})', format='\\1 \\2 \\3', leading_digits_pattern=['5'], national_prefix_formatting_rule='0\\1')],
intl_number_format=[NumberFormat(pattern='(\\d)(\\d{3,12})', format='\\1 \\2', leading_digits_pattern=['1(?:11|[2-9])']),
NumberFormat(pattern='(\\d{3})(\\d{2})', format='\\1 \\2', leading_digits_pattern=['517']),
NumberFormat(pattern='(\\d{2})(\\d{3,5})', format='\\1 \\2', leading_digits_pattern=['5[079]']),
NumberFormat(pattern='(\\d{3})(\\d{3,10})', format='\\1 \\2', leading_digits_pattern=['(?:31|4)6|51|6(?:5[0-3579]|[6-9])|7(?:20|32|8)|[89]']),
NumberFormat(pattern='(\\d{4})(\\d{3,9})', format='\\1 \\2', leading_digits_pattern=['[2-467]|5[2-6]']),
NumberFormat(pattern='(\\d{2})(\\d{3})(\\d{3,4})', format='\\1 \\2 \\3', leading_digits_pattern=['5']),
NumberFormat(pattern='(\\d{2})(\\d{4})(\\d{4,7})', format='\\1 \\2 \\3', leading_digits_pattern=['5'])],
mobile_number_portable_region=True)

View file

@ -0,0 +1,33 @@
"""Auto-generated file, do not edit by hand. AU metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_AU = PhoneMetadata(id='AU', country_code=61, international_prefix='001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011',
general_desc=PhoneNumberDesc(national_number_pattern='1(?:[0-79]\\d{7}(?:\\d(?:\\d{2})?)?|8[0-24-9]\\d{7})|[2-478]\\d{8}|1\\d{4,7}', possible_length=(5, 6, 7, 8, 9, 10, 12)),
fixed_line=PhoneNumberDesc(national_number_pattern='(?:(?:(?:2(?:[0-26-9]\\d|3[0-8]|4[02-9]|5[0135-9])|7(?:[013-57-9]\\d|2[0-8]))\\d|3(?:(?:[0-3589]\\d|6[1-9]|7[0-35-9])\\d|4(?:[0-578]\\d|90)))\\d\\d|8(?:51(?:0(?:0[03-9]|[12479]\\d|3[2-9]|5[0-8]|6[1-9]|8[0-7])|1(?:[0235689]\\d|1[0-69]|4[0-589]|7[0-47-9])|2(?:0[0-79]|[18][13579]|2[14-9]|3[0-46-9]|[4-6]\\d|7[89]|9[0-4])|3\\d\\d)|(?:6[0-8]|[78]\\d)\\d{3}|9(?:[02-9]\\d{3}|1(?:(?:[0-58]\\d|6[0135-9])\\d|7(?:0[0-24-9]|[1-9]\\d)|9(?:[0-46-9]\\d|5[0-79])))))\\d{3}', example_number='212345678', possible_length=(9,), possible_length_local_only=(8,)),
mobile=PhoneNumberDesc(national_number_pattern='4(?:(?:79|94)[01]|83[0-389])\\d{5}|4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[0-26-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\d{6}', example_number='412345678', possible_length=(9,)),
toll_free=PhoneNumberDesc(national_number_pattern='180(?:0\\d{3}|2)\\d{3}', example_number='1800123456', possible_length=(7, 10)),
premium_rate=PhoneNumberDesc(national_number_pattern='190[0-26]\\d{6}', example_number='1900123456', possible_length=(10,)),
shared_cost=PhoneNumberDesc(national_number_pattern='13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}', example_number='1300123456', possible_length=(6, 8, 10, 12)),
voip=PhoneNumberDesc(national_number_pattern='14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}', example_number='147101234', possible_length=(9,)),
pager=PhoneNumberDesc(national_number_pattern='163\\d{2,6}', example_number='1631234', possible_length=(5, 6, 7, 8, 9)),
no_international_dialling=PhoneNumberDesc(national_number_pattern='1(?:3(?:00\\d{5}|45[0-4])|802)\\d{3}|1[38]00\\d{6}|13\\d{4}', possible_length=(6, 7, 8, 10, 12)),
preferred_international_prefix='0011',
national_prefix='0',
national_prefix_for_parsing='(183[12])|0',
number_format=[NumberFormat(pattern='(\\d{2})(\\d{3,4})', format='\\1 \\2', leading_digits_pattern=['16'], national_prefix_formatting_rule='0\\1'),
NumberFormat(pattern='(\\d{2})(\\d{2})(\\d{2})', format='\\1 \\2 \\3', leading_digits_pattern=['13']),
NumberFormat(pattern='(\\d{3})(\\d{3})', format='\\1 \\2', leading_digits_pattern=['19']),
NumberFormat(pattern='(\\d{3})(\\d{4})', format='\\1 \\2', leading_digits_pattern=['180', '1802']),
NumberFormat(pattern='(\\d{4})(\\d{3,4})', format='\\1 \\2', leading_digits_pattern=['19']),
NumberFormat(pattern='(\\d{2})(\\d{3})(\\d{2,4})', format='\\1 \\2 \\3', leading_digits_pattern=['16'], national_prefix_formatting_rule='0\\1'),
NumberFormat(pattern='(\\d{3})(\\d{3})(\\d{3})', format='\\1 \\2 \\3', leading_digits_pattern=['14|4'], national_prefix_formatting_rule='0\\1'),
NumberFormat(pattern='(\\d)(\\d{4})(\\d{4})', format='\\1 \\2 \\3', leading_digits_pattern=['[2378]'], national_prefix_formatting_rule='(0\\1)', domestic_carrier_code_formatting_rule='$CC (\\1)'),
NumberFormat(pattern='(\\d{4})(\\d{3})(\\d{3})', format='\\1 \\2 \\3', leading_digits_pattern=['1(?:30|[89])']),
NumberFormat(pattern='(\\d{4})(\\d{4})(\\d{4})', format='\\1 \\2 \\3', leading_digits_pattern=['130'])],
intl_number_format=[NumberFormat(pattern='(\\d{2})(\\d{3,4})', format='\\1 \\2', leading_digits_pattern=['16']),
NumberFormat(pattern='(\\d{2})(\\d{3})(\\d{2,4})', format='\\1 \\2 \\3', leading_digits_pattern=['16']),
NumberFormat(pattern='(\\d{3})(\\d{3})(\\d{3})', format='\\1 \\2 \\3', leading_digits_pattern=['14|4']),
NumberFormat(pattern='(\\d)(\\d{4})(\\d{4})', format='\\1 \\2 \\3', leading_digits_pattern=['[2378]']),
NumberFormat(pattern='(\\d{4})(\\d{3})(\\d{3})', format='\\1 \\2 \\3', leading_digits_pattern=['1(?:30|[89])'])],
main_country_for_code=True,
mobile_number_portable_region=True)

View file

@ -0,0 +1,11 @@
"""Auto-generated file, do not edit by hand. AW metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_AW = PhoneMetadata(id='AW', country_code=297, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='(?:[25-79]\\d\\d|800)\\d{4}', possible_length=(7,)),
fixed_line=PhoneNumberDesc(national_number_pattern='5(?:2\\d|8[1-9])\\d{4}', example_number='5212345', possible_length=(7,)),
mobile=PhoneNumberDesc(national_number_pattern='(?:290|5[69]\\d|6(?:[03]0|22|4[0-2]|[69]\\d)|7(?:[34]\\d|7[07])|9(?:6[45]|9[4-8]))\\d{4}', example_number='5601234', possible_length=(7,)),
toll_free=PhoneNumberDesc(national_number_pattern='800\\d{4}', example_number='8001234', possible_length=(7,)),
premium_rate=PhoneNumberDesc(national_number_pattern='900\\d{4}', example_number='9001234', possible_length=(7,)),
voip=PhoneNumberDesc(national_number_pattern='(?:28\\d|501)\\d{4}', example_number='5011234', possible_length=(7,)),
number_format=[NumberFormat(pattern='(\\d{3})(\\d{4})', format='\\1 \\2', leading_digits_pattern=['[25-9]'])])

View file

@ -0,0 +1,14 @@
"""Auto-generated file, do not edit by hand. AX metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_AX = PhoneMetadata(id='AX', country_code=358, international_prefix='00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))',
general_desc=PhoneNumberDesc(national_number_pattern='2\\d{4,9}|35\\d{4,5}|(?:60\\d\\d|800)\\d{4,6}|7\\d{5,11}|(?:[14]\\d|3[0-46-9]|50)\\d{4,8}', possible_length=(5, 6, 7, 8, 9, 10, 11, 12)),
fixed_line=PhoneNumberDesc(national_number_pattern='18[1-8]\\d{3,6}', example_number='181234567', possible_length=(6, 7, 8, 9)),
mobile=PhoneNumberDesc(national_number_pattern='4946\\d{2,6}|(?:4[0-8]|50)\\d{4,8}', example_number='412345678', possible_length=(6, 7, 8, 9, 10)),
toll_free=PhoneNumberDesc(national_number_pattern='800\\d{4,6}', example_number='800123456', possible_length=(7, 8, 9)),
premium_rate=PhoneNumberDesc(national_number_pattern='[67]00\\d{5,6}', example_number='600123456', possible_length=(8, 9)),
uan=PhoneNumberDesc(national_number_pattern='20\\d{4,8}|60[12]\\d{5,6}|7(?:099\\d{4,5}|5[03-9]\\d{3,7})|20[2-59]\\d\\d|(?:606|7(?:0[78]|1|3\\d))\\d{7}|(?:10|29|3[09]|70[1-5]\\d)\\d{4,8}', example_number='10112345', possible_length=(5, 6, 7, 8, 9, 10, 11, 12)),
preferred_international_prefix='00',
national_prefix='0',
national_prefix_for_parsing='0',
leading_digits='18')

View file

@ -0,0 +1,19 @@
"""Auto-generated file, do not edit by hand. AZ metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_AZ = PhoneMetadata(id='AZ', country_code=994, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='365\\d{6}|(?:[124579]\\d|60|88)\\d{7}', possible_length=(9,), possible_length_local_only=(7,)),
fixed_line=PhoneNumberDesc(national_number_pattern='(?:2[12]428|3655[02])\\d{4}|(?:2(?:22[0-79]|63[0-28])|3654)\\d{5}|(?:(?:1[28]|46)\\d|2(?:[014-6]2|[23]3))\\d{6}', example_number='123123456', possible_length=(9,), possible_length_local_only=(7,)),
mobile=PhoneNumberDesc(national_number_pattern='36554\\d{4}|(?:[16]0|4[04]|5[015]|7[07]|99)\\d{7}', example_number='401234567', possible_length=(9,)),
toll_free=PhoneNumberDesc(national_number_pattern='88\\d{7}', example_number='881234567', possible_length=(9,)),
premium_rate=PhoneNumberDesc(national_number_pattern='900200\\d{3}', example_number='900200123', possible_length=(9,)),
national_prefix='0',
national_prefix_for_parsing='0',
number_format=[NumberFormat(pattern='(\\d{3})(\\d{2})(\\d{2})', format='\\1 \\2 \\3', leading_digits_pattern=['[1-9]']),
NumberFormat(pattern='(\\d{3})(\\d{2})(\\d{2})(\\d{2})', format='\\1 \\2 \\3 \\4', leading_digits_pattern=['90'], national_prefix_formatting_rule='0\\1'),
NumberFormat(pattern='(\\d{2})(\\d{3})(\\d{2})(\\d{2})', format='\\1 \\2 \\3 \\4', leading_digits_pattern=['1[28]|2|365|46', '1[28]|2|365[45]|46', '1[28]|2|365(?:4|5[02])|46'], national_prefix_formatting_rule='(0\\1)'),
NumberFormat(pattern='(\\d{2})(\\d{3})(\\d{2})(\\d{2})', format='\\1 \\2 \\3 \\4', leading_digits_pattern=['[13-9]'], national_prefix_formatting_rule='0\\1')],
intl_number_format=[NumberFormat(pattern='(\\d{3})(\\d{2})(\\d{2})(\\d{2})', format='\\1 \\2 \\3 \\4', leading_digits_pattern=['90']),
NumberFormat(pattern='(\\d{2})(\\d{3})(\\d{2})(\\d{2})', format='\\1 \\2 \\3 \\4', leading_digits_pattern=['1[28]|2|365|46', '1[28]|2|365[45]|46', '1[28]|2|365(?:4|5[02])|46']),
NumberFormat(pattern='(\\d{2})(\\d{3})(\\d{2})(\\d{2})', format='\\1 \\2 \\3 \\4', leading_digits_pattern=['[13-9]'])],
mobile_number_portable_region=True)

View file

@ -0,0 +1,21 @@
"""Auto-generated file, do not edit by hand. BA metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_BA = PhoneMetadata(id='BA', country_code=387, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='6\\d{8}|(?:[35689]\\d|49|70)\\d{6}', possible_length=(8, 9), possible_length_local_only=(6,)),
fixed_line=PhoneNumberDesc(national_number_pattern='(?:3(?:[05-79][2-9]|1[4579]|[23][24-9]|4[2-4689]|8[2457-9])|49[2-579]|5(?:0[2-49]|[13][2-9]|[268][2-4679]|4[4689]|5[2-79]|7[2-69]|9[2-4689]))\\d{5}', example_number='30212345', possible_length=(8,), possible_length_local_only=(6,)),
mobile=PhoneNumberDesc(national_number_pattern='6040\\d{5}|6(?:03|[1-356]|44|7\\d)\\d{6}', example_number='61123456', possible_length=(8, 9)),
toll_free=PhoneNumberDesc(national_number_pattern='8[08]\\d{6}', example_number='80123456', possible_length=(8,)),
premium_rate=PhoneNumberDesc(national_number_pattern='9[0246]\\d{6}', example_number='90123456', possible_length=(8,)),
shared_cost=PhoneNumberDesc(national_number_pattern='8[12]\\d{6}', example_number='82123456', possible_length=(8,)),
uan=PhoneNumberDesc(national_number_pattern='703[235]0\\d{3}|70(?:2[0-5]|3[0146]|[56]0)\\d{4}', example_number='70341234', possible_length=(8,)),
national_prefix='0',
national_prefix_for_parsing='0',
number_format=[NumberFormat(pattern='(\\d{3})(\\d{3})', format='\\1-\\2', leading_digits_pattern=['[2-9]']),
NumberFormat(pattern='(\\d{2})(\\d{3})(\\d{3})', format='\\1 \\2 \\3', leading_digits_pattern=['6[1-3]|[7-9]'], national_prefix_formatting_rule='0\\1'),
NumberFormat(pattern='(\\d{2})(\\d{3})(\\d{3})', format='\\1 \\2-\\3', leading_digits_pattern=['[3-5]|6[56]'], national_prefix_formatting_rule='0\\1'),
NumberFormat(pattern='(\\d{2})(\\d{2})(\\d{2})(\\d{3})', format='\\1 \\2 \\3 \\4', leading_digits_pattern=['6'], national_prefix_formatting_rule='0\\1')],
intl_number_format=[NumberFormat(pattern='(\\d{2})(\\d{3})(\\d{3})', format='\\1 \\2 \\3', leading_digits_pattern=['6[1-3]|[7-9]']),
NumberFormat(pattern='(\\d{2})(\\d{3})(\\d{3})', format='\\1 \\2-\\3', leading_digits_pattern=['[3-5]|6[56]']),
NumberFormat(pattern='(\\d{2})(\\d{2})(\\d{2})(\\d{3})', format='\\1 \\2 \\3 \\4', leading_digits_pattern=['6'])],
mobile_number_portable_region=True)

View file

@ -0,0 +1,17 @@
"""Auto-generated file, do not edit by hand. BB metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_BB = PhoneMetadata(id='BB', country_code=1, international_prefix='011',
general_desc=PhoneNumberDesc(national_number_pattern='(?:246|[58]\\d\\d|900)\\d{7}', possible_length=(10,), possible_length_local_only=(7,)),
fixed_line=PhoneNumberDesc(national_number_pattern='246521[0369]\\d{3}|246(?:2(?:2[78]|7[0-4])|4(?:1[024-6]|2\\d|3[2-9])|5(?:20|[34]\\d|54|7[1-3])|6(?:2\\d|38)|7[35]7|9(?:1[89]|63))\\d{4}', example_number='2464123456', possible_length=(10,), possible_length_local_only=(7,)),
mobile=PhoneNumberDesc(national_number_pattern='246(?:(?:2(?:[3568]\\d|4[0-57-9])|3(?:5[2-9]|6[0-6])|4(?:46|5\\d)|69[5-7]|8(?:[2-5]\\d|83))\\d|52(?:1[147]|20))\\d{3}', example_number='2462501234', possible_length=(10,), possible_length_local_only=(7,)),
toll_free=PhoneNumberDesc(national_number_pattern='8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', example_number='8002123456', possible_length=(10,)),
premium_rate=PhoneNumberDesc(national_number_pattern='(?:246976|900[2-9]\\d\\d)\\d{4}', example_number='9002123456', possible_length=(10,), possible_length_local_only=(7,)),
personal_number=PhoneNumberDesc(national_number_pattern='52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}', example_number='5002345678', possible_length=(10,)),
voip=PhoneNumberDesc(national_number_pattern='24631\\d{5}', example_number='2463101234', possible_length=(10,), possible_length_local_only=(7,)),
uan=PhoneNumberDesc(national_number_pattern='246(?:292|367|4(?:1[7-9]|3[01]|4[47-9]|67)|7(?:1[2-9]|2\\d|3[016]|53))\\d{4}', example_number='2464301234', possible_length=(10,), possible_length_local_only=(7,)),
national_prefix='1',
national_prefix_for_parsing='([2-9]\\d{6})$|1',
national_prefix_transform_rule='246\\1',
leading_digits='246',
mobile_number_portable_region=True)

View file

@ -0,0 +1,15 @@
"""Auto-generated file, do not edit by hand. BD metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_BD = PhoneMetadata(id='BD', country_code=880, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[1-469]\\d{9}|8[0-79]\\d{7,8}|[2-79]\\d{8}|[2-9]\\d{7}|[3-9]\\d{6}|[57-9]\\d{5}', possible_length=(6, 7, 8, 9, 10)),
fixed_line=PhoneNumberDesc(national_number_pattern='(?:4(?:31\\d\\d|423)|5222)\\d{3}(?:\\d{2})?|8332[6-9]\\d\\d|(?:3(?:03[56]|224)|4(?:22[25]|653))\\d{3,4}|(?:3(?:42[47]|529|823)|4(?:027|525|65(?:28|8))|562|6257|7(?:1(?:5[3-5]|6[12]|7[156]|89)|22[589]56|32|42675|52(?:[25689](?:56|8)|[347]8)|71(?:6[1267]|75|89)|92374)|82(?:2[59]|32)56|9(?:03[23]56|23(?:256|373)|31|5(?:1|2[4589]56)))\\d{3}|(?:3(?:02[348]|22[35]|324|422)|4(?:22[67]|32[236-9]|6(?:2[46]|5[57])|953)|5526|6(?:024|6655)|81)\\d{4,5}|(?:2(?:7(?:1[0-267]|2[0-289]|3[0-29]|4[01]|5[1-3]|6[013]|7[0178]|91)|8(?:0[125]|1[1-6]|2[0157-9]|3[1-69]|41|6[1-35]|7[1-5]|8[1-8]|9[0-6])|9(?:0[0-2]|1[0-4]|2[568]|3[3-6]|5[5-7]|6[0136-9]|7[0-7]|8[014-9]))|3(?:0(?:2[025-79]|3[2-4])|181|22[12]|32[2356]|824)|4(?:02[09]|22[348]|32[045]|523|6(?:27|54))|666(?:22|53)|7(?:22[57-9]|42[56]|82[35])8|8(?:0[124-9]|2(?:181|2[02-4679]8)|4[12]|[5-7]2)|9(?:[04]2|2(?:2|328)|81))\\d{4}|(?:2(?:222|[45]\\d)\\d|3(?:1(?:2[5-7]|[5-7])|425|822)|4(?:033|1\\d|[257]1|332|4(?:2[246]|5[25])|6(?:2[35]|56|62)|8(?:23|54)|92[2-5])|5(?:02[03489]|22[457]|32[35-79]|42[46]|6(?:[18]|53)|724|826)|6(?:023|2(?:2[2-5]|5[3-5]|8)|32[3478]|42[34]|52[47]|6(?:[18]|6(?:2[34]|5[24]))|[78]2[2-5]|92[2-6])|7(?:02|21\\d|[3-589]1|6[12]|72[24])|8(?:217|3[12]|[5-7]1)|9[24]1)\\d{5}|(?:(?:3[2-8]|5[2-57-9]|6[03-589])1|4[4689][18])\\d{5}|[59]1\\d{5}', example_number='27111234', possible_length=(6, 7, 8, 9, 10)),
mobile=PhoneNumberDesc(national_number_pattern='(?:1[13-9]\\d|644)\\d{7}|(?:3[78]|44|66)[02-9]\\d{7}', example_number='1812345678', possible_length=(10,)),
toll_free=PhoneNumberDesc(national_number_pattern='80[03]\\d{7}', example_number='8001234567', possible_length=(10,)),
voip=PhoneNumberDesc(national_number_pattern='96(?:0[469]|1[0-47]|3[389]|43|6[69]|7[78])\\d{6}', example_number='9604123456', possible_length=(10,)),
national_prefix='0',
national_prefix_for_parsing='0',
number_format=[NumberFormat(pattern='(\\d{2})(\\d{4,6})', format='\\1-\\2', leading_digits_pattern=['31[5-8]|[459]1'], national_prefix_formatting_rule='0\\1'),
NumberFormat(pattern='(\\d{3})(\\d{3,7})', format='\\1-\\2', leading_digits_pattern=['3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:[15]|28|4[14])|7[2-589]|8(?:0[014-9]|[12])|9[358]|(?:3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(?:44|66)[01346-9]'], national_prefix_formatting_rule='0\\1'),
NumberFormat(pattern='(\\d{4})(\\d{3,6})', format='\\1-\\2', leading_digits_pattern=['[13-9]|22'], national_prefix_formatting_rule='0\\1'),
NumberFormat(pattern='(\\d)(\\d{7,8})', format='\\1-\\2', leading_digits_pattern=['2'], national_prefix_formatting_rule='0\\1')])

View file

@ -0,0 +1,18 @@
"""Auto-generated file, do not edit by hand. BE metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_BE = PhoneMetadata(id='BE', country_code=32, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='4\\d{8}|[1-9]\\d{7}', possible_length=(8, 9)),
fixed_line=PhoneNumberDesc(national_number_pattern='80[2-8]\\d{5}|(?:1[0-69]|[23][2-8]|4[23]|5\\d|6[013-57-9]|71|8[1-79]|9[2-4])\\d{6}', example_number='12345678', possible_length=(8,)),
mobile=PhoneNumberDesc(national_number_pattern='4[5-9]\\d{7}', example_number='470123456', possible_length=(9,)),
toll_free=PhoneNumberDesc(national_number_pattern='800[1-9]\\d{4}', example_number='80012345', possible_length=(8,)),
premium_rate=PhoneNumberDesc(national_number_pattern='(?:70(?:2[0-57]|3[04-7]|44|6[4-69]|7[0579])|90\\d\\d)\\d{4}', example_number='90012345', possible_length=(8,)),
shared_cost=PhoneNumberDesc(national_number_pattern='7879\\d{4}', example_number='78791234', possible_length=(8,)),
uan=PhoneNumberDesc(national_number_pattern='78(?:0[57]|1[014-8]|2[25]|3[15-8]|48|[56]0|7[06-8]|9\\d)\\d{4}', example_number='78102345', possible_length=(8,)),
national_prefix='0',
national_prefix_for_parsing='0',
number_format=[NumberFormat(pattern='(\\d{3})(\\d{2})(\\d{3})', format='\\1 \\2 \\3', leading_digits_pattern=['(?:80|9)0'], national_prefix_formatting_rule='0\\1'),
NumberFormat(pattern='(\\d)(\\d{3})(\\d{2})(\\d{2})', format='\\1 \\2 \\3 \\4', leading_digits_pattern=['[239]|4[23]'], national_prefix_formatting_rule='0\\1'),
NumberFormat(pattern='(\\d{2})(\\d{2})(\\d{2})(\\d{2})', format='\\1 \\2 \\3 \\4', leading_digits_pattern=['[15-8]'], national_prefix_formatting_rule='0\\1'),
NumberFormat(pattern='(\\d{3})(\\d{2})(\\d{2})(\\d{2})', format='\\1 \\2 \\3 \\4', leading_digits_pattern=['4'], national_prefix_formatting_rule='0\\1')],
mobile_number_portable_region=True)

View file

@ -0,0 +1,8 @@
"""Auto-generated file, do not edit by hand. BF metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_BF = PhoneMetadata(id='BF', country_code=226, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[025-7]\\d{7}', possible_length=(8,)),
fixed_line=PhoneNumberDesc(national_number_pattern='2(?:0(?:49|5[23]|6[5-7]|9[016-9])|4(?:4[569]|5[4-6]|6[5-7]|7[0179])|5(?:[34]\\d|50|6[5-7]))\\d{4}', example_number='20491234', possible_length=(8,)),
mobile=PhoneNumberDesc(national_number_pattern='(?:0[1-35-7]|5[0-8]|[67]\\d)\\d{6}', example_number='70123456', possible_length=(8,)),
number_format=[NumberFormat(pattern='(\\d{2})(\\d{2})(\\d{2})(\\d{2})', format='\\1 \\2 \\3 \\4', leading_digits_pattern=['[025-7]'])])

View file

@ -0,0 +1,30 @@
"""Auto-generated file, do not edit by hand. BG metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_BG = PhoneMetadata(id='BG', country_code=359, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='00800\\d{7}|[2-7]\\d{6,7}|[89]\\d{6,8}|2\\d{5}', possible_length=(6, 7, 8, 9, 12), possible_length_local_only=(4, 5)),
fixed_line=PhoneNumberDesc(national_number_pattern='2\\d{5,7}|(?:43[1-6]|70[1-9])\\d{4,5}|(?:[36]\\d|4[124-7]|[57][1-9]|8[1-6]|9[1-7])\\d{5,6}', example_number='2123456', possible_length=(6, 7, 8), possible_length_local_only=(4, 5)),
mobile=PhoneNumberDesc(national_number_pattern='(?:43[07-9]|99[69]\\d)\\d{5}|(?:8[7-9]|98)\\d{7}', example_number='43012345', possible_length=(8, 9)),
toll_free=PhoneNumberDesc(national_number_pattern='(?:00800\\d\\d|800)\\d{5}', example_number='80012345', possible_length=(8, 12)),
premium_rate=PhoneNumberDesc(national_number_pattern='90\\d{6}', example_number='90123456', possible_length=(8,)),
shared_cost=PhoneNumberDesc(national_number_pattern='700\\d{5}', example_number='70012345', possible_length=(8,)),
national_prefix='0',
national_prefix_for_parsing='0',
number_format=[NumberFormat(pattern='(\\d{6})', format='\\1', leading_digits_pattern=['1']),
NumberFormat(pattern='(\\d)(\\d)(\\d{2})(\\d{2})', format='\\1 \\2 \\3 \\4', leading_digits_pattern=['2'], national_prefix_formatting_rule='0\\1'),
NumberFormat(pattern='(\\d{3})(\\d{4})', format='\\1 \\2', leading_digits_pattern=['43[1-6]|70[1-9]'], national_prefix_formatting_rule='0\\1'),
NumberFormat(pattern='(\\d)(\\d{3})(\\d{3,4})', format='\\1 \\2 \\3', leading_digits_pattern=['2'], national_prefix_formatting_rule='0\\1'),
NumberFormat(pattern='(\\d{2})(\\d{3})(\\d{2,3})', format='\\1 \\2 \\3', leading_digits_pattern=['[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]'], national_prefix_formatting_rule='0\\1'),
NumberFormat(pattern='(\\d{3})(\\d{2})(\\d{3})', format='\\1 \\2 \\3', leading_digits_pattern=['(?:70|8)0'], national_prefix_formatting_rule='0\\1'),
NumberFormat(pattern='(\\d{3})(\\d{3})(\\d{2})', format='\\1 \\2 \\3', leading_digits_pattern=['43[1-7]|7'], national_prefix_formatting_rule='0\\1'),
NumberFormat(pattern='(\\d{2})(\\d{3})(\\d{3,4})', format='\\1 \\2 \\3', leading_digits_pattern=['[48]|9[08]'], national_prefix_formatting_rule='0\\1'),
NumberFormat(pattern='(\\d{3})(\\d{3})(\\d{3})', format='\\1 \\2 \\3', leading_digits_pattern=['9'], national_prefix_formatting_rule='0\\1')],
intl_number_format=[NumberFormat(pattern='(\\d)(\\d)(\\d{2})(\\d{2})', format='\\1 \\2 \\3 \\4', leading_digits_pattern=['2']),
NumberFormat(pattern='(\\d{3})(\\d{4})', format='\\1 \\2', leading_digits_pattern=['43[1-6]|70[1-9]']),
NumberFormat(pattern='(\\d)(\\d{3})(\\d{3,4})', format='\\1 \\2 \\3', leading_digits_pattern=['2']),
NumberFormat(pattern='(\\d{2})(\\d{3})(\\d{2,3})', format='\\1 \\2 \\3', leading_digits_pattern=['[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]']),
NumberFormat(pattern='(\\d{3})(\\d{2})(\\d{3})', format='\\1 \\2 \\3', leading_digits_pattern=['(?:70|8)0']),
NumberFormat(pattern='(\\d{3})(\\d{3})(\\d{2})', format='\\1 \\2 \\3', leading_digits_pattern=['43[1-7]|7']),
NumberFormat(pattern='(\\d{2})(\\d{3})(\\d{3,4})', format='\\1 \\2 \\3', leading_digits_pattern=['[48]|9[08]']),
NumberFormat(pattern='(\\d{3})(\\d{3})(\\d{3})', format='\\1 \\2 \\3', leading_digits_pattern=['9'])],
mobile_number_portable_region=True)

View file

@ -0,0 +1,12 @@
"""Auto-generated file, do not edit by hand. BH metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_BH = PhoneMetadata(id='BH', country_code=973, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[136-9]\\d{7}', possible_length=(8,)),
fixed_line=PhoneNumberDesc(national_number_pattern='(?:1(?:3[1356]|6[0156]|7\\d)\\d|6(?:1[16]\\d|500|6(?:0\\d|3[12]|44|55|7[7-9]|88)|9[69][69])|7(?:[07]\\d\\d|1(?:11|78)))\\d{4}', example_number='17001234', possible_length=(8,)),
mobile=PhoneNumberDesc(national_number_pattern='(?:3(?:[0-79]\\d|8[0-57-9])\\d|6(?:3(?:00|33|6[16])|441|6(?:3[03-9]|[69]\\d|7[0-689])))\\d{4}', example_number='36001234', possible_length=(8,)),
toll_free=PhoneNumberDesc(national_number_pattern='8[02369]\\d{6}', example_number='80123456', possible_length=(8,)),
premium_rate=PhoneNumberDesc(national_number_pattern='(?:87|9[0-8])\\d{6}', example_number='90123456', possible_length=(8,)),
shared_cost=PhoneNumberDesc(national_number_pattern='84\\d{6}', example_number='84123456', possible_length=(8,)),
number_format=[NumberFormat(pattern='(\\d{4})(\\d{4})', format='\\1 \\2', leading_digits_pattern=['[13679]|8[02-4679]'])],
mobile_number_portable_region=True)

View file

@ -0,0 +1,8 @@
"""Auto-generated file, do not edit by hand. BI metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_BI = PhoneMetadata(id='BI', country_code=257, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='(?:[267]\\d|31)\\d{6}', possible_length=(8,)),
fixed_line=PhoneNumberDesc(national_number_pattern='(?:22|31)\\d{6}', example_number='22201234', possible_length=(8,)),
mobile=PhoneNumberDesc(national_number_pattern='(?:29|[67][125-9])\\d{6}', example_number='79561234', possible_length=(8,)),
number_format=[NumberFormat(pattern='(\\d{2})(\\d{2})(\\d{2})(\\d{2})', format='\\1 \\2 \\3 \\4', leading_digits_pattern=['[2367]'])])

View file

@ -0,0 +1,10 @@
"""Auto-generated file, do not edit by hand. BJ metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_BJ = PhoneMetadata(id='BJ', country_code=229, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[24-689]\\d{7}', possible_length=(8,)),
fixed_line=PhoneNumberDesc(national_number_pattern='2(?:02|1[037]|2[45]|3[68]|4\\d)\\d{5}', example_number='20211234', possible_length=(8,)),
mobile=PhoneNumberDesc(national_number_pattern='(?:4[0-7]|[56]\\d|9[013-9])\\d{6}', example_number='90011234', possible_length=(8,)),
voip=PhoneNumberDesc(national_number_pattern='857[58]\\d{4}', example_number='85751234', possible_length=(8,)),
uan=PhoneNumberDesc(national_number_pattern='81\\d{6}', example_number='81123456', possible_length=(8,)),
number_format=[NumberFormat(pattern='(\\d{2})(\\d{2})(\\d{2})(\\d{2})', format='\\1 \\2 \\3 \\4', leading_digits_pattern=['[24-689]'])])

View file

@ -0,0 +1,12 @@
"""Auto-generated file, do not edit by hand. BL metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_BL = PhoneMetadata(id='BL', country_code=590, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='590\\d{6}|(?:69|80|9\\d)\\d{7}', possible_length=(9,)),
fixed_line=PhoneNumberDesc(national_number_pattern='590(?:2[7-9]|3[3-7]|5[12]|87)\\d{4}', example_number='590271234', possible_length=(9,)),
mobile=PhoneNumberDesc(national_number_pattern='69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))\\d{4}', example_number='690001234', possible_length=(9,)),
toll_free=PhoneNumberDesc(national_number_pattern='80[0-5]\\d{6}', example_number='800012345', possible_length=(9,)),
voip=PhoneNumberDesc(national_number_pattern='9(?:(?:395|76[018])\\d|475[0-5])\\d{4}', example_number='976012345', possible_length=(9,)),
national_prefix='0',
national_prefix_for_parsing='0',
mobile_number_portable_region=True)

View file

@ -0,0 +1,15 @@
"""Auto-generated file, do not edit by hand. BM metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_BM = PhoneMetadata(id='BM', country_code=1, international_prefix='011',
general_desc=PhoneNumberDesc(national_number_pattern='(?:441|[58]\\d\\d|900)\\d{7}', possible_length=(10,), possible_length_local_only=(7,)),
fixed_line=PhoneNumberDesc(national_number_pattern='441(?:[46]\\d\\d|5(?:4\\d|60|89))\\d{4}', example_number='4414123456', possible_length=(10,), possible_length_local_only=(7,)),
mobile=PhoneNumberDesc(national_number_pattern='441909\\d{4}|441(?:[2378]\\d|5[0-39]|92)\\d{5}', example_number='4413701234', possible_length=(10,), possible_length_local_only=(7,)),
toll_free=PhoneNumberDesc(national_number_pattern='8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', example_number='8002123456', possible_length=(10,)),
premium_rate=PhoneNumberDesc(national_number_pattern='900[2-9]\\d{6}', example_number='9002123456', possible_length=(10,)),
personal_number=PhoneNumberDesc(national_number_pattern='52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}', example_number='5002345678', possible_length=(10,)),
national_prefix='1',
national_prefix_for_parsing='([2-9]\\d{6})$|1',
national_prefix_transform_rule='441\\1',
leading_digits='441',
mobile_number_portable_region=True)

View file

@ -0,0 +1,9 @@
"""Auto-generated file, do not edit by hand. BN metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_BN = PhoneMetadata(id='BN', country_code=673, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[2-578]\\d{6}', possible_length=(7,)),
fixed_line=PhoneNumberDesc(national_number_pattern='22[0-7]\\d{4}|(?:2[013-9]|[34]\\d|5[0-25-9])\\d{5}', example_number='2345678', possible_length=(7,)),
mobile=PhoneNumberDesc(national_number_pattern='(?:22[89]|[78]\\d\\d)\\d{4}', example_number='7123456', possible_length=(7,)),
voip=PhoneNumberDesc(national_number_pattern='5[34]\\d{5}', example_number='5345678', possible_length=(7,)),
number_format=[NumberFormat(pattern='(\\d{3})(\\d{4})', format='\\1 \\2', leading_digits_pattern=['[2-578]'])])

View file

@ -0,0 +1,14 @@
"""Auto-generated file, do not edit by hand. BO metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_BO = PhoneMetadata(id='BO', country_code=591, international_prefix='00(?:1\\d)?',
general_desc=PhoneNumberDesc(national_number_pattern='(?:[2-467]\\d\\d|8001)\\d{5}', possible_length=(8, 9), possible_length_local_only=(7,)),
fixed_line=PhoneNumberDesc(national_number_pattern='(?:2(?:2\\d\\d|5(?:11|[258]\\d|9[67])|6(?:12|2\\d|9[34])|8(?:2[34]|39|62))|3(?:3\\d\\d|4(?:6\\d|8[24])|8(?:25|42|5[257]|86|9[25])|9(?:[27]\\d|3[2-4]|4[248]|5[24]|6[2-6]))|4(?:4\\d\\d|6(?:11|[24689]\\d|72)))\\d{4}', example_number='22123456', possible_length=(8,), possible_length_local_only=(7,)),
mobile=PhoneNumberDesc(national_number_pattern='[67]\\d{7}', example_number='71234567', possible_length=(8,)),
toll_free=PhoneNumberDesc(national_number_pattern='8001[07]\\d{4}', example_number='800171234', possible_length=(9,)),
no_international_dialling=PhoneNumberDesc(national_number_pattern='8001[07]\\d{4}', possible_length=(9,)),
national_prefix='0',
national_prefix_for_parsing='0(1\\d)?',
number_format=[NumberFormat(pattern='(\\d)(\\d{7})', format='\\1 \\2', leading_digits_pattern=['[23]|4[46]'], domestic_carrier_code_formatting_rule='0$CC \\1'),
NumberFormat(pattern='(\\d{8})', format='\\1', leading_digits_pattern=['[67]'], domestic_carrier_code_formatting_rule='0$CC \\1'),
NumberFormat(pattern='(\\d{3})(\\d{2})(\\d{4})', format='\\1 \\2 \\3', leading_digits_pattern=['8'], domestic_carrier_code_formatting_rule='0$CC \\1')])

View file

@ -0,0 +1,8 @@
"""Auto-generated file, do not edit by hand. BQ metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_BQ = PhoneMetadata(id='BQ', country_code=599, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='(?:[34]1|7\\d)\\d{5}', possible_length=(7,)),
fixed_line=PhoneNumberDesc(national_number_pattern='(?:318[023]|41(?:6[023]|70)|7(?:1[578]|2[05]|50)\\d)\\d{3}', example_number='7151234', possible_length=(7,)),
mobile=PhoneNumberDesc(national_number_pattern='(?:31(?:8[14-8]|9[14578])|416[14-9]|7(?:0[01]|7[07]|8\\d|9[056])\\d)\\d{3}', example_number='3181234', possible_length=(7,)),
leading_digits='[347]')

View file

@ -0,0 +1,26 @@
"""Auto-generated file, do not edit by hand. BR metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_BR = PhoneMetadata(id='BR', country_code=55, international_prefix='00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)',
general_desc=PhoneNumberDesc(national_number_pattern='(?:[1-46-9]\\d\\d|5(?:[0-46-9]\\d|5[0-46-9]))\\d{8}|[1-9]\\d{9}|[3589]\\d{8}|[34]\\d{7}', possible_length=(8, 9, 10, 11)),
fixed_line=PhoneNumberDesc(national_number_pattern='(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-5]\\d{7}', example_number='1123456789', possible_length=(10,), possible_length_local_only=(8,)),
mobile=PhoneNumberDesc(national_number_pattern='(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])(?:7|9\\d)\\d{7}', example_number='11961234567', possible_length=(10, 11), possible_length_local_only=(8, 9)),
toll_free=PhoneNumberDesc(national_number_pattern='800\\d{6,7}', example_number='800123456', possible_length=(9, 10)),
premium_rate=PhoneNumberDesc(national_number_pattern='300\\d{6}|[59]00\\d{6,7}', example_number='300123456', possible_length=(9, 10)),
shared_cost=PhoneNumberDesc(national_number_pattern='(?:30[03]\\d{3}|4(?:0(?:0\\d|20)|370))\\d{4}|300\\d{5}', example_number='40041234', possible_length=(8, 10)),
no_international_dialling=PhoneNumberDesc(national_number_pattern='30(?:0\\d{5,7}|3\\d{7})|40(?:0\\d|20)\\d{4}|800\\d{6,7}', possible_length=(8, 9, 10)),
national_prefix='0',
national_prefix_for_parsing='(?:0|90)(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?',
national_prefix_transform_rule='\\2',
number_format=[NumberFormat(pattern='(\\d{3,6})', format='\\1', leading_digits_pattern=['1(?:1[25-8]|2[357-9]|3[02-68]|4[12568]|5|6[0-8]|8[015]|9[0-47-9])|321|610']),
NumberFormat(pattern='(\\d{4})(\\d{4})', format='\\1-\\2', leading_digits_pattern=['300|4(?:0[02]|37)', '4(?:02|37)0|[34]00']),
NumberFormat(pattern='(\\d{4})(\\d{4})', format='\\1-\\2', leading_digits_pattern=['[2-57]', '[2357]|4(?:[0-24-9]|3(?:[0-689]|7[1-9]))']),
NumberFormat(pattern='(\\d{3})(\\d{2,3})(\\d{4})', format='\\1 \\2 \\3', leading_digits_pattern=['(?:[358]|90)0'], national_prefix_formatting_rule='0\\1'),
NumberFormat(pattern='(\\d{5})(\\d{4})', format='\\1-\\2', leading_digits_pattern=['9']),
NumberFormat(pattern='(\\d{2})(\\d{4})(\\d{4})', format='\\1 \\2-\\3', leading_digits_pattern=['(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]'], national_prefix_formatting_rule='(\\1)', domestic_carrier_code_formatting_rule='0 $CC (\\1)'),
NumberFormat(pattern='(\\d{2})(\\d{5})(\\d{4})', format='\\1 \\2-\\3', leading_digits_pattern=['[16][1-9]|[2-57-9]'], national_prefix_formatting_rule='(\\1)', domestic_carrier_code_formatting_rule='0 $CC (\\1)')],
intl_number_format=[NumberFormat(pattern='(\\d{4})(\\d{4})', format='\\1-\\2', leading_digits_pattern=['300|4(?:0[02]|37)', '4(?:02|37)0|[34]00']),
NumberFormat(pattern='(\\d{3})(\\d{2,3})(\\d{4})', format='\\1 \\2 \\3', leading_digits_pattern=['(?:[358]|90)0']),
NumberFormat(pattern='(\\d{2})(\\d{4})(\\d{4})', format='\\1 \\2-\\3', leading_digits_pattern=['(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]']),
NumberFormat(pattern='(\\d{2})(\\d{5})(\\d{4})', format='\\1 \\2-\\3', leading_digits_pattern=['[16][1-9]|[2-57-9]'])],
mobile_number_portable_region=True)

View file

@ -0,0 +1,16 @@
"""Auto-generated file, do not edit by hand. BS metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_BS = PhoneMetadata(id='BS', country_code=1, international_prefix='011',
general_desc=PhoneNumberDesc(national_number_pattern='(?:242|[58]\\d\\d|900)\\d{7}', possible_length=(10,), possible_length_local_only=(7,)),
fixed_line=PhoneNumberDesc(national_number_pattern='242(?:3(?:02|[236][1-9]|4[0-24-9]|5[0-68]|7[347]|8[0-4]|9[2-467])|461|502|6(?:0[1-5]|12|2[013]|[45]0|7[67]|8[78]|9[89])|7(?:02|88))\\d{4}', example_number='2423456789', possible_length=(10,), possible_length_local_only=(7,)),
mobile=PhoneNumberDesc(national_number_pattern='242(?:3(?:5[79]|7[56]|95)|4(?:[23][1-9]|4[1-35-9]|5[1-8]|6[2-8]|7\\d|81)|5(?:2[45]|3[35]|44|5[1-46-9]|65|77)|6[34]6|7(?:27|38)|8(?:0[1-9]|1[02-9]|2\\d|[89]9))\\d{4}', example_number='2423591234', possible_length=(10,), possible_length_local_only=(7,)),
toll_free=PhoneNumberDesc(national_number_pattern='242300\\d{4}|8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', example_number='8002123456', possible_length=(10,), possible_length_local_only=(7,)),
premium_rate=PhoneNumberDesc(national_number_pattern='900[2-9]\\d{6}', example_number='9002123456', possible_length=(10,)),
personal_number=PhoneNumberDesc(national_number_pattern='52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}', example_number='5002345678', possible_length=(10,)),
uan=PhoneNumberDesc(national_number_pattern='242225\\d{4}', example_number='2422250123', possible_length=(10,)),
national_prefix='1',
national_prefix_for_parsing='([3-8]\\d{6})$|1',
national_prefix_transform_rule='242\\1',
leading_digits='242',
mobile_number_portable_region=True)

Some files were not shown because too many files have changed in this diff Show more