Merge to upstream commit c210dbca4e93; relevant code changes:
- Introduced new
is_carrier_specific_for_region
API inshortnumberinfo
. This determines whether the provided short code is carrier-specific or not when dialed from the given region.
Merge to upstream commit 1eb06f31e1dd; relevant code changes:
- Removing the ability for
.._for_region
methods inshortnumberinfo.py
to work on strings, as well of phone number objects. These have been marked deprecated for months. Any users of these methods should callphonenumbers.parse
first to create aPhoneNumber
object, and pass this in. - Support semicolon as extension character while parsing phone numbers. This is not applicable when you are trying to find the phone numbers.
Merge to upstream commit e905483f87cf; relevant code changes:
- Removing all references to
possible_number_pattern
other than in the metadata itself.
Merge to upstream commit fedbc7020703; code changes:
- GitHub project changes:
- Changed tag to
vX.Y.Z
fromrelease-X.Y.Z
; this may affect ports and derived projects.
- Changed tag to
- Metadata structure changes in XML file:
- Mobile and Fixed-Line blocks are no longer assumed to inherit missing data
from the GeneralDesc, but are treated like every other phone number type.
This means that for the non-geographical country codes, like +800, the
example number has been moved from generalDesc to the relevant number types,
and the code in getExampleNumberForNonGeoEntity has been changed to look at
these sub-types for an example number.
This also means that the "NA" and "-1" blocks present in the metadata to
indicate that no mobile or fixed-line numbers appear for the entity have been
removed.
There should no longer be an
exampleNumber
at thegeneralDesc
level, but it should be present at everyPhoneNumberDesc
with data.
- Mobile and Fixed-Line blocks are no longer assumed to inherit missing data
from the GeneralDesc, but are treated like every other phone number type.
This means that for the non-geographical country codes, like +800, the
example number has been moved from generalDesc to the relevant number types,
and the code in getExampleNumberForNonGeoEntity has been changed to look at
these sub-types for an example number.
This also means that the "NA" and "-1" blocks present in the metadata to
indicate that no mobile or fixed-line numbers appear for the entity have been
removed.
There should no longer be an
- Code changes:
- Using new
possibleLengthInfo
to decide whether a short number is the right length or not. This could result in more specific results; whereas before, a number from length 3 to length 6 may have been deemed possible, now we may exclude a number of length 5. - Add hash (#) as a diallable character. Numbers with # in them will no longer
have formatting applied in
format_n_original_format
, andnormalize_diallable_chars_only
now retains the # symbol. example_number_for_non_geo_entity
has been changed to look at the specific number types, not just the generalDesc, for the example numbers; this is a necessary change after the metadata structure change detailed above.
- Using new
Merge to upstream commit ad0ce0c94501; code changes:
- Fixed
phonemetadata.py
not to merge from aNumberFormat
's unset boolnational_prefix_optional_when_formatting
.
Merge to upstream commit 2d0d216f6032; code changes:
- Stop setting empty
preferred_domestic_carrier_code
, and if we are passed such a number then treat the empty field as if unset.
Merge to upstream commit 8c37310deb49; code changes:
- Switching the internal implementation of
is_possible_number
and related functions to use the newpossibleLengths
metadata. This affects a lot of countries, makingis_possible_number
more restrictive as more precise data is available. It also affects parsing ambiguous and invalid numbers, as we decide whether to strip a possible national prefix (1) or country code based on the length of the number and whether it is possible before or after this. - Formatting, naming and comment tweaks to follow style guide
- Removal of unneeded
_can_be_geocoded
method in thetimezone.py
file, usingphonenumberutil.py
instead
Merge to upstream commit 1ec4d341c3cd; no code changes that affect the Python version so this is just a version bump to stay in sync with upstream.
Merge to upstream commit 7cc500f588db; code changes:
phonemetadata.py
has two more fields to represent possible lengths of phone numbers. Changedbuildmetadatafromxml.py
to alter the way that metadata about possible-lengths information is consumed when constructing metadata to populate these. Discussion list email
Merge to upstream commit ddf60b1c175e; code changes:
- Made
is_number_geographical()
public and addedis_number_type_geographical()
, and changed the geocoder to use this when checking whether to give a detailed answer or country-level only.
Merge to upstream commit 3f83454ed62b; no code changes that affect the Python version so this is just a version bump to stay in sync with upstream.
Merge to upstream commit 598b9a4f89d6; no code changes that affect the Python version so this is just a version bump to stay in sync with upstream.
Merge to upstream commit d933631fbf15; code changes:
- Added support for
region_code of None in example_number_for_type()
- Added
invalid_example_number()
- Improvements to docstring for parse method
- Update
is_number_geographical
to return true for geographical mobile numbers.
Merge to upstream commit ab5e61acc087ec9f5, which is 7.2.1 (7.2.0 had an immediate problem on release); upstream changelog mentions no code changes, but the Java implementation includes a change to use nano protobufs.
Merge to upstream commit 903ac5de5b6e1112; upstream code changelog:
- Only upstream code change doesn't affect python version
(New
MetadataSource
implementation that reads from a single metadata file with all regions' phone number metadata.)
Merge to upstream Subversion revision 715; upstream code changelog:
- New APIs for ShortNumberInfo. The old APIs have been deprecated and will be removed in an upcoming release.
Merge to upstream Subversion revision 703; upstream code changelog:
- Changing the offline geocoder to not return any country at all if the number could belong to multiple countries
- Removing obsolete code that treated countries with no metadata as valid.
Merge to upstream Subversion revision 674; upstream code changelog:
- Better exclusion of dates when matching phone numbers from text.
- Handle phone input in RFC3966 with missing tel: prefix
Merge to upstream Subversion revision 656; upstream code changelog:
- Adding MetadataLoader support to allow custom metadata loading from alternative sources (should have no visible impact to users).
- Fixing bug where digits could be lost in as-you-type formatting and formatting patterns incorrectly applied.
Split geographic metadata into chunks.
Generate separate phonenumbers-lite
package.
(No upstream changes.)
Removed beta status. Merge up to upstream Subversion revision 650; upstream code changelog:
- Better support for detecting phone numbers in text that are beside each other
- Change to how Japanese numbers beginning with "00" are modelled, with the side-effect that the maximum possible number length has been extended by 1.
- Handle
StringIndexOutOfBoundsException
in theAsYouTypeFormatter
when the national prefix that was extracted was not found in the prefix. This affected countries with very long carrier codes, such as Korea. - Removal of some of the author attributions - contributions to be tracked in CONTRIBUTORS file.
The codebase now supports Python 2.5-2.7 and Python 3.x out of the box, without needing 2to3 conversion.
The top-level module no longer exports the following functions:
country_name_for_number
description_for_number
description_for_valid_number
These functions now need to be imported via the phonenumbers.geocoder
submodule.
The short number functions have been renamed:
is_possible_short_number_object
becomesis_possible_short_number
is_possible_short_number
becomesis_possible_short_number_for_object
is_valid_short_number_object
becomesis_valid_short_number
is_valid_short_number
becomesis_valid_short_number_for_object
expected_cost
becomesexpected_cost_for_region
, and there's a newexpected_cost
function that takes aPhoneNumber
object.
Merge up to upstream Subversion revision 622; upstream code changelog:
- Adding support for numbers with multiple Italian leading zeros, by adding a field to the phone number proto to allow an arbitrary number of leading zeros, and supporting this when parsing, validating and formatting.
- Adding more functionality to
ShortNumberInfo
-> such asGetExpectedCostForRegion
. - Fix for parsing short numbers that start with the national prefix.
- Updating
FormatNumberForMobileDialing
to work with short numbers. - Stop finding Israeli 4-digit "star" numbers in text when no star is in fact present.
- Bug fix for finding phone numbers where the area code was also part of the country calling code.
Rename shortnumberutil.py
to shortnumberinfo.py
.
Merge up to upstream Subversion revision 603; upstream code changelog:
- Renamed
ShortNumberUtil
toShortNumberInfo
-> the former class is now deprecated and will be deleted in a later release. At the moment it just delegates toShortNumberInfo
. - New methods in the
ShortNumberInfo
API -isCarrierSpecific
, singleton interface,isPossibleShortNumber
,isValidShortNumber
,getShortNumberCost
. Note this is an experimental API at the moment and subject to change. - Bug fixes:
- AsYouTypeFormatting: 3-digit numbers can be formatted as a group where appropriate
- AsYouTypeFormatting: Countries with an optional national prefix were considered before to have always entered it, resulting in bugs where numbers without the national prefix were not properly formatted.
- Numbers in Chile that overlap with emergency numbers are no longer marked as connecting to them
- Not requiring the NDC to be alone for countries where there is no national prefix in strict grouping when extracting phone numbers
Fix setup.py
to include new .shortdata
sub-package.
Merge up to upstream Subversion revision 594; upstream code changelog:
- Improve phone number extraction recall.
- Add support for loading short number metadata.
Merge up to upstream Subversion revision 579; upstream code changelog:
- Fix for as-you-type-formatting bug affecting countries with no national prefix formatting rule, such as China.
Merge up to upstream Subversion revision 574; upstream code changelog:
- Changed internal initialization code and made more fields final. Note that we now throw an exception if an attempt is made to set the metadata more than once (which should only happen during testing).
- Fix problem with
formatNumberForMobileDialing
for HU and CL.
Load metadata on demand rather than all at start of day. Merge up to upstream Subversion revision 557; upstream code changelog:
- Switch
formatNumberForMobileDialing
to prefer national format to international format when the number is dialed from the same region the phone number is from.
Merge up to upstream Subversion revision 550; upstream code changelog:
- Handling UAN numbers in Argentina better when dialling them locally from a mobile
Merge up to upstream Subversion revision 532.
Merge up to upstream Subversion revision 516.
Merge up to upstream Subversion revision 500. The upstream metadata at r489 didn't match the generated Java code in 5.0; this upstream revision fixed the mismatch.
Merge up to upstream Subversion revision 492.
Merge up to upstream Subversion revision 469.
Merge up to upstream Subversion revision 441.
Merge up to upstream Subversion revision 431.
Merge up to upstream Subversion revision 426. Reinstated Python 2.5 support, accidentally broken since 4.3.
Merge up to upstream Subversion revision 419.
Merge up to upstream Subversion revision 411.
Merge up to upstream Subversion revision 396. Adjust codebase to allow 2to3 generation of Python 3.x version.
Merge up to upstream Subversion revision 383.
Merge up to upstream Subversion revision 374.
Merge up to upstream Subversion revision 362.
Merge up to upstream Subversion revision 353.
Merge up to upstream Subversion revision 325. Includes initial simplistic implementation of geocoding functionality.
Merge up to upstream Subversion revision 289 (but geocoding functionality not yet ported).
Merge up to upstream Subversion revision 277 (but geocoding functionality not yet ported). Require Python 2.5, to allow import unicodedata.
Fix GH-3: crash in parse()
for number with blank metadata
Merge up to upstream Subversion revision 213.
Merge up to upstream Subversion revision 205. Changed version marker from a to b. More unit test coverage
Merge up to upstream Subversion revision 190.
Merge up to upstream version 3.3, Subversion revision 171.
Initial port of libphonenumber, from http://code.google.com/p/libphonenumber/
This version based on upstream version 3.2, Subversion revision 166 of: http://libphonenumber.googlecode.com/svn/trunk/java