Skip to main content

closeio-phonenumbers

Low-memory CPython bindings for Google's C++ libphonenumber implementation. It provides a compatibility-focused subset of the widely used phonenumbers Python API, backed by libphonenumber's native parser, formatter, matcher, and geocoder.

The distribution is named closeio-phonenumbers, while the installed import package is named phonenumbers:

import phonenumbers

Do not install closeio-phonenumbers and the pure-Python phonenumbers distribution in the same environment. Both provide the same import package.

This is not yet a drop-in replacement for every phonenumbers API. See COMPATIBILITY.md for the supported surface.

Features

  • International phone-number parsing, formatting, and validation
  • Region and number-type lookup
  • Phone-number extraction from Unicode text
  • Offline geographic descriptions
  • Lazy phone-prefix timezone lookup
  • Typed Python interfaces
  • Repaired wheels with non-system native dependencies bundled

Installation

python -m pip install closeio-phonenumbers

Prebuilt wheels are available for the following targets:

Python Platform Architectures
CPython 3.12–3.14 Linux (manylinux 2.28+) x86-64, ARM64
CPython 3.12–3.14 macOS 15+ x86-64, Apple Silicon

Installing a wheel does not require a compiler or ICU, Protobuf, or libphonenumber development packages.

Usage

import phonenumbers
from phonenumbers import geocoder, timezone

number = phonenumbers.parse("+1 415-333-4444")

phonenumbers.is_valid_number(number)
# True

phonenumbers.format_number(number, phonenumbers.PhoneNumberFormat.E164)
# "+14153334444"

phonenumbers.region_code_for_number(number)
# "US"

geocoder.description_for_number(number, "en")
# "San Francisco, CA"

timezone.time_zones_for_number(number)
# ("America/Los_Angeles",)

Find numbers in text with PhoneNumberMatcher:

text = "Call +1 415-333-4444 or +44 20 7219 4272."
for match in phonenumbers.PhoneNumberMatcher(text, region=None):
    print(match.start, match.end, match.raw_string)

Versioning and source inputs

Versions have the form <libphonenumber version>.<binding revision>. For example, 9.0.34.1 is binding revision 1 over libphonenumber 9.0.34.

The libphonenumber and fallback Abseil source archives are pinned by SHA-256. Both archives are included in the source distribution, allowing it to build without network access once the declared Python and system build dependencies are installed. Geographic and timezone metadata come from the same pinned libphonenumber release.

Building from source

A source build requires Python 3.12–3.14, a C++17 compiler, CMake, Ninja, ICU development headers, Protocol Buffers headers, and protoc. A Git checkout also needs the pinned source archives; a source distribution already includes them.

On Ubuntu:

sudo apt-get install \
  build-essential cmake ninja-build pkg-config python3-dev \
  libicu-dev libprotobuf-dev protobuf-compiler
python tools/fetch_libphonenumber.py
python -m pip install build pytest
python -m build --wheel
python -m pip install dist/*.whl
python -m pytest

On macOS:

brew install cmake icu4c ninja pkg-config protobuf
export CMAKE_PREFIX_PATH="$(brew --prefix icu4c):$(brew --prefix protobuf)"
export PKG_CONFIG_PATH="$(brew --prefix icu4c)/lib/pkgconfig:\
$(brew --prefix protobuf)/lib/pkgconfig"
python tools/fetch_libphonenumber.py
python -m pip install build pytest
python -m build --wheel
python -m pip install dist/*.whl
python -m pytest

Use python -m cibuildwheel --platform linux or --platform macos to produce repaired wheels using the configuration in pyproject.toml.

Contributing

See CONTRIBUTING.md for development checks and instructions for updating the pinned libphonenumber metadata.

License

Licensed under the Apache License 2.0. See LICENSE and NOTICE for attribution. This project is not affiliated with or endorsed by Google.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

closeio_phonenumbers-9.0.34.1.tar.gz (14.8 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

closeio_phonenumbers-9.0.34.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (17.0 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

closeio_phonenumbers-9.0.34.1-cp314-cp314-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (16.7 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.26+ ARM64manylinux: glibc 2.28+ ARM64

closeio_phonenumbers-9.0.34.1-cp314-cp314-macosx_15_0_x86_64.whl (18.2 MB view details)

Uploaded CPython 3.14macOS 15.0+ x86-64

closeio_phonenumbers-9.0.34.1-cp314-cp314-macosx_15_0_arm64.whl (18.0 MB view details)

Uploaded CPython 3.14macOS 15.0+ ARM64

closeio_phonenumbers-9.0.34.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (17.0 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

closeio_phonenumbers-9.0.34.1-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (16.7 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.26+ ARM64manylinux: glibc 2.28+ ARM64

closeio_phonenumbers-9.0.34.1-cp313-cp313-macosx_15_0_x86_64.whl (18.2 MB view details)

Uploaded CPython 3.13macOS 15.0+ x86-64

closeio_phonenumbers-9.0.34.1-cp313-cp313-macosx_15_0_arm64.whl (18.0 MB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

closeio_phonenumbers-9.0.34.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (17.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

closeio_phonenumbers-9.0.34.1-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (16.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.26+ ARM64manylinux: glibc 2.28+ ARM64

closeio_phonenumbers-9.0.34.1-cp312-cp312-macosx_15_0_x86_64.whl (18.2 MB view details)

Uploaded CPython 3.12macOS 15.0+ x86-64

closeio_phonenumbers-9.0.34.1-cp312-cp312-macosx_15_0_arm64.whl (18.0 MB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

File details

Details for the file closeio_phonenumbers-9.0.34.1.tar.gz.

File metadata

  • Download URL: closeio_phonenumbers-9.0.34.1.tar.gz
  • Upload date:
  • Size: 14.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for closeio_phonenumbers-9.0.34.1.tar.gz
Algorithm Hash digest
SHA256 279261e7a05e74ca2d3d345461b09b65d5f6f455be51d3e1d911a37ed6087d42
MD5 bbba2226953bdaf07baca99b3bbb58fd
BLAKE2b-256 39c93fd2ed6f7a2410b08efeb10211aa922682829762c8123c2c527542014430

See more details on using hashes here.

Provenance

The following attestation bundles were made for closeio_phonenumbers-9.0.34.1.tar.gz:

Publisher: ci.yml on closeio/libphonenumber-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file closeio_phonenumbers-9.0.34.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for closeio_phonenumbers-9.0.34.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c7aebedb56c85440bfe3ee30b99048dc92338556c820e319193d71bdc06e065b
MD5 d3467e3b23309a841c94cd3f0764dfc0
BLAKE2b-256 ea34dcc033f41eb8584aeebcf8a5a0671880be903a09776956bf0cd18b12cf1a

See more details on using hashes here.

Provenance

The following attestation bundles were made for closeio_phonenumbers-9.0.34.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: ci.yml on closeio/libphonenumber-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file closeio_phonenumbers-9.0.34.1-cp314-cp314-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for closeio_phonenumbers-9.0.34.1-cp314-cp314-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 af2418d65c987b1bb21468f5337f478d6a14863493cb4312595a09a6051ced3d
MD5 61ec5c5ae92a5740931e1bcaa0d012a9
BLAKE2b-256 57e1856d90106e19a82fcbe766ad1afe026dfdde2e457e9889803d8c03f0dbc0

See more details on using hashes here.

Provenance

The following attestation bundles were made for closeio_phonenumbers-9.0.34.1-cp314-cp314-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl:

Publisher: ci.yml on closeio/libphonenumber-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file closeio_phonenumbers-9.0.34.1-cp314-cp314-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for closeio_phonenumbers-9.0.34.1-cp314-cp314-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 0567fedc1876a1658e3ee971af4faaf8c9645a35ad0fd388cc17f123ad0e9328
MD5 4f3916628b060c70fec88e096d476819
BLAKE2b-256 871f297771488a9825a6fae5cc966be78465be74f722e2a6e34eb0609e2ac517

See more details on using hashes here.

Provenance

The following attestation bundles were made for closeio_phonenumbers-9.0.34.1-cp314-cp314-macosx_15_0_x86_64.whl:

Publisher: ci.yml on closeio/libphonenumber-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file closeio_phonenumbers-9.0.34.1-cp314-cp314-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for closeio_phonenumbers-9.0.34.1-cp314-cp314-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 f19f279beac89b00caf5ee49284d31e48c7d69e5d80cbab2ad5d226ab2e4051d
MD5 b781f5b41e0ebdccb87646a338186625
BLAKE2b-256 67ecfda263d748ce5c01e419e6091a3b884d45b86b6deabe8c3d7795ff19aecf

See more details on using hashes here.

Provenance

The following attestation bundles were made for closeio_phonenumbers-9.0.34.1-cp314-cp314-macosx_15_0_arm64.whl:

Publisher: ci.yml on closeio/libphonenumber-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file closeio_phonenumbers-9.0.34.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for closeio_phonenumbers-9.0.34.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1c2846a09cffaf03b388205ec1e296ea197395007522c858956a7e4a46438415
MD5 9c8df2ae38ec764793929fbd3ef805d3
BLAKE2b-256 f94a74a195f72c55d1b14a26ed04a5072eecdfea34d373106d9c856df65e784f

See more details on using hashes here.

Provenance

The following attestation bundles were made for closeio_phonenumbers-9.0.34.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: ci.yml on closeio/libphonenumber-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file closeio_phonenumbers-9.0.34.1-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for closeio_phonenumbers-9.0.34.1-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 215a66b77d04a42991ebd84a2d9c6b378eae3fe5053135202cf4593894d4be53
MD5 1331b9f9d6ca00d0fc5b5042634ae444
BLAKE2b-256 0b6da23ea24d9704cf2b0269fc969459b5918349a349315f448d790d0a36d4bd

See more details on using hashes here.

Provenance

The following attestation bundles were made for closeio_phonenumbers-9.0.34.1-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl:

Publisher: ci.yml on closeio/libphonenumber-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file closeio_phonenumbers-9.0.34.1-cp313-cp313-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for closeio_phonenumbers-9.0.34.1-cp313-cp313-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 ab62b6c7e3b3e4b101f0e292e0e40041ba0ba5b03911e98aad66db26da849c69
MD5 aa529d27d67b53b38325d08241cabd93
BLAKE2b-256 cfede3154155f215221665653bbde630f7c7b9f338133dc335f848de500f67c7

See more details on using hashes here.

Provenance

The following attestation bundles were made for closeio_phonenumbers-9.0.34.1-cp313-cp313-macosx_15_0_x86_64.whl:

Publisher: ci.yml on closeio/libphonenumber-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file closeio_phonenumbers-9.0.34.1-cp313-cp313-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for closeio_phonenumbers-9.0.34.1-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 6f576bfb408d11cd3be7030bdc1e00ee1e01c8e4423ffc3f9f127975b043e484
MD5 02c80691610a5592592a707d789099f9
BLAKE2b-256 3b1f3c93ee7d82eac603009185a82f0d4b67cf5660495518bd5b278ccf2a7108

See more details on using hashes here.

Provenance

The following attestation bundles were made for closeio_phonenumbers-9.0.34.1-cp313-cp313-macosx_15_0_arm64.whl:

Publisher: ci.yml on closeio/libphonenumber-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file closeio_phonenumbers-9.0.34.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for closeio_phonenumbers-9.0.34.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3afb93d5350c2cd9c4e2055fd516397d164435d9588cfd1a1f2688f3dc72dcae
MD5 6ad2cbc9102cc7a08094e87d7a615e3e
BLAKE2b-256 f31d4ba12dbd2b5cbcaf93b3eb4b86fabe6f0afa4f63b8f476a51bf412b33652

See more details on using hashes here.

Provenance

The following attestation bundles were made for closeio_phonenumbers-9.0.34.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: ci.yml on closeio/libphonenumber-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file closeio_phonenumbers-9.0.34.1-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for closeio_phonenumbers-9.0.34.1-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 0d2e2b339ad94bf5366c0de27f6a919d75a9d66eb32419d2d83f7123a353e61b
MD5 80a1563cb890a0cefc0f304b9034ca71
BLAKE2b-256 d5bbe1eefb69af78d3dc726d320d6f95b26d975baabf9b0e3725a7fffc28c255

See more details on using hashes here.

Provenance

The following attestation bundles were made for closeio_phonenumbers-9.0.34.1-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl:

Publisher: ci.yml on closeio/libphonenumber-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file closeio_phonenumbers-9.0.34.1-cp312-cp312-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for closeio_phonenumbers-9.0.34.1-cp312-cp312-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 2ea6aed6b582c4d56b6ca9223a732d6ca58fe5e30f9971da6d174f3d3b032fda
MD5 4a202197d765a340f3c1a2eb9858b292
BLAKE2b-256 605f6a35b160fcd0216cd01b6c5e133c32afe2bcbec0a94cea2b44577b06a6fb

See more details on using hashes here.

Provenance

The following attestation bundles were made for closeio_phonenumbers-9.0.34.1-cp312-cp312-macosx_15_0_x86_64.whl:

Publisher: ci.yml on closeio/libphonenumber-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file closeio_phonenumbers-9.0.34.1-cp312-cp312-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for closeio_phonenumbers-9.0.34.1-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 c42e430b7e3fa064fee1457b8221491ac18ab3d96ead6a6cccc9c95eff3ce830
MD5 ecdf309639adda2bffd7db24c6f1d674
BLAKE2b-256 e0cca4602fc84abe734617180e65426999df71fa54f5e546b037c90bc2344bf1

See more details on using hashes here.

Provenance

The following attestation bundles were made for closeio_phonenumbers-9.0.34.1-cp312-cp312-macosx_15_0_arm64.whl:

Publisher: ci.yml on closeio/libphonenumber-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page