NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #655 most downloaded on PyPI
Python version of Google's common library for parsing, formatting, storing and validating international phone numbers.
Last release 8 days ago
24 Sep 2026
Ships on a steady schedule
a new release about every 2 weeks
Rarely documented
notes for 13 of the last 60 stable releases
1 version withdrawn
withdrawn after publishing
15 years old
304 releases · first in 2011
Nothing published for this version
Nothing published for this version
Merge to upstream commit d62a8fb2b719; relevant code changes:
Merge to upstream commit d62a8fb2b719; relevant code changes:
One column per quarter.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Merge to upstream commit d56bf9da349b; relevant code changes:
Merge to upstream commit d56bf9da349b; relevant code changes:
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Just metadata changes.
Just metadata changes.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Merge to upstream commit 7e4e754bda09; relevant code changes:
Merge to upstream commit 7e4e754bda09; relevant code changes:
IS_POSSIBLE_LOCAL_ONLY and
INVALID_LENGTH). Enables e.g. adding Iran short-codes starting with "096"
without the need to hack IR's national prefix parsing config.Merge to upstream commit fb9aa53ecfa3; relevant code changes:
Merge to upstream commit fb9aa53ecfa3; relevant code changes:
number_typeMerge to upstream commit 1ad92eb35a44; relevant code changes:
Merge to upstream commit 1ad92eb35a44; relevant code changes:
supported_calling_codes() API to return all the calling codes
that the library considers valid, both for geographical and non-geographical
entities.is_sms_service_for_region(numobj, region_dialing_from) API in
short number info library. An SMS service is where the primary or only
intended usage is to receive and/or send text messages (SMSs). This includes
MMS as MMS numbers downgrade to SMS if the other party isn't MMS-capable. The
is_sms_service metadata is also serialized for the first time._VALID_PUNCTUATION and
_SINGLE_INTERNATIONAL_PREFIX, also renaming the latter from
_UNIQUE_INTERNATIONAL_PREFIX.Merge to upstream commit 242a186f1fbf; relevant code changes:
Merge to upstream commit 242a186f1fbf; relevant code changes:
leading_zero_possible from the metadata and all the places it is
referenced in the build and prod code. Will be removed from the metadata
proto itself in a subsequent release. This should not affect users of the
library - the only place it was used was format_in_original_format, and only
initially to try and avoid modifying the input number by removing/adding
digits inadvertently. Now this is checked at the end of the method anyway.
However slight formatting differences with this method on invalid numbers
starting with 0s may be noticed in some countries.is_number_geographical API.parse() method to point users at
keep_raw_input parameter.CountryCodeSource called UNSPECIFIED. This is used as a
default value, and will be returned if someone calls parse(keep_raw_input=False) and then
.country_code_sourc on the result. If users want an actual value for this
then they should call parse(keep_raw_input=True) instead; the values that were
previously returned after calling this method will not change.Nothing published for this version
Nothing published for this version
Merge to upstream commit 52cff9d8837f; relevant code changes:
Merge to upstream commit 52cff9d8837f; relevant code changes:
can_be_internationally_dialled public API; This was already in JS.Nothing published for this version
Merge to upstream commit 9923d9211432; relevant code changes:
Merge to upstream commit 9923d9211432; relevant code changes:
Merge to upstream commit 02dbc0921cf5; relevant code changes:
Merge to upstream commit 02dbc0921cf5; relevant code changes:
is_possible_with_reason to return the enums INVALID_LENGTH and
IS_POSSIBLE_LOCAL_ONLY, where these apply. is_possible_number continues to
consider IS_POSSIBLE or IS_POSSIBLE_LOCAL_ONLY numbers as possible to dial.
Announcement: https://groups.google.com/d/msg/libphonenumber-discuss/sPhYzdzFCmg/6tYsS1f6DgAJregion_code_for_number to clarify that it does not
work for short-codes or invalid numbers.Merge to upstream commit 77affd08f65f; relevant code changes:
Merge to upstream commit 77affd08f65f; relevant code changes:
phonemetadata.proto file.is_possible_number_for_type and
is_possible_number_for_type_with_reason, along with supported_types_for_region and
supported_types_for_non_geo_entity. These allow you to query which types (e.g.
Mobile) exist for a particular region, and work out if a number is possible
for that type (this is a simple length check) rather than for the region as a
whole.Merge to upstream commit 46a38545ba01; relevant code changes:
Merge to upstream commit 46a38545ba01; relevant code changes:
geocoder.py to explain the cases where an empty string might be returned.Metadata changes only.
Metadata changes only.
Merge to upstream commit 5507fdbf623f; relevant code changes:
Merge to upstream commit 5507fdbf623f; relevant code changes:
national_significant_number more robust in the face of malicious
input. This now ignores the number_of_leading_zeros if they are less than
zero.Merge to upstream commit ad297a10ba19; relevant code changes:
Merge to upstream commit ad297a10ba19; relevant code changes:
ValidationResult - IS_POSSIBLE_LOCAL_ONLY and
INVALID_LENGTH. Added more documentation to the existing values; see the
docstrings for when these are going to be used. Note that the API for
is_possible_number_with_reason has not yet been changed to return these values.
IS_POSSIBLE_LOCAL_ONLY will be returned for some values which currently
return IS_POSSIBLE, and INVALID_LENGTH will be returned for some values which
currently return TOO_LONG.is_number_match to ignore the number_of_leading_zeros field when comparing
numbers unless italian_leading_zero is True, and to consider default values
to match the same value when explicitly set for these two fields. This fix
shouldn't be needed for anyone correctly creating phone numbers using "parse"
as recommended.Merge to upstream commit 3b16d6b06497; relevant code changes:
Merge to upstream commit 3b16d6b06497; relevant code changes:
normalize_diallable_chars_only. This method is already public in the C++
implementation. It has also now been added to the Javascript implementation.Merge to upstream commit c210dbca4e93; relevant code changes:
Merge to upstream commit c210dbca4e93; relevant code changes:
is_carrier_specific_for_region API in shortnumberinfo.
This determines whether the provided short code is carrier-specific or
not when dialed from the given region.Nothing published for this version
…of phone number objects. These have been marked deprecated for months. Any users of these methods should call phonenumbers.parse first to create a Pho…
Merge to upstream commit 1eb06f31e1dd; relevant code changes:
.._for_region methods in shortnumberinfo.py to work
on strings, as well of phone number objects. These have been marked deprecated
for months. Any users of these methods should call phonenumbers.parse first to
create a PhoneNumber object, and pass this in.Merge to upstream commit e905483f87cf; relevant code changes:
Merge to upstream commit e905483f87cf; relevant code changes:
possible_number_pattern other than in the metadata
itself.Merge to upstream commit fedbc7020703; code changes:
Merge to upstream commit fedbc7020703; code changes:
vX.Y.Z from release-X.Y.Z; this may affect ports and derived projects.exampleNumber at the generalDesc level, but it
should be present at every PhoneNumberDesc with data.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.format_n_original_format, and
normalize_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.Merge to upstream commit ad0ce0c94501; code changes:
Merge to upstream commit ad0ce0c94501; code changes:
phonemetadata.py not to merge from a NumberFormat's unset bool
national_prefix_optional_when_formatting.Merge to upstream commit 2d0d216f6032; code changes:
Merge to upstream commit 2d0d216f6032; code changes:
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:
Merge to upstream commit 8c37310deb49; code changes:
is_possible_number and related functions
to use the new possibleLengths metadata. This affects a lot of countries,
making is_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._can_be_geocoded method in the
timezone.py file, using phonenumberutil.py insteadMerge 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 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:
Merge to upstream commit 7cc500f588db; code changes:
phonemetadata.py has two more fields to represent possible lengths of phone
numbers. Changed buildmetadatafromxml.py to alter the way
that metadata about possible-lengths information is consumed when constructing
metadata to populate these.
Discussion list emailMerge to upstream commit ddf60b1c175e; code changes:
Merge to upstream commit ddf60b1c175e; code changes:
is_number_geographical() public and added is_number_type_geographical(),
and changed the geocoder to use this when checking whether to give a detailed
answer or country-level only.Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →