Contents

phonenumbers 8.13.34

0

Python version of Google's common library for parsing, formatting, storing and validating internatio

Python version of Google's common library for parsing, formatting, storing and validating international phone numbers.

Stars: 3395, Watchers: 3395, Forks: 409, Open Issues: 9

The daviddrysdale/python-phonenumbers repo was created 12 years ago and the last code push was 4 days ago.
The project is very popular with an impressive 3395 github stars!

How to Install phonenumbers

You can install phonenumbers using pip

pip install phonenumbers

or add it to a project with poetry

poetry add phonenumbers

Package Details

Author
David Drysdale
License
Apache License 2.0
Homepage
https://github.com/daviddrysdale/python-phonenumbers
PyPi:
https://pypi.org/project/phonenumbers/
GitHub Repo:
https://github.com/daviddrysdale/python-phonenumbers

Classifiers

  • Communications/Telephony
No  phonenumbers  pypi packages just yet.

Errors

A list of common phonenumbers errors.

Code Examples

Here are some phonenumbers code examples and snippets.

  • [phonenumbers] validate phone numbers in python

    If you need to validate phone numbers in python the phonenumbers module is a great library Installation Instructions pip install phonenumbers Code Example import phonenumbers x = phonenumbers.parse("+442083661177", None) print(x) type(x) y = phonenumbers.parse("020 8366 1177", "GB") print(y) print(x == y) # as dialed from GB, not a GB number z = phonenumbers.parse("00 1 650 253 2222", "GB") print(z) z = phonenumbers.parse("+120012301", None) phonenumbers.is_valid_number(z) # output Country Code: 44 National Number: 2083661177 Country Code: 44 National Number: 2083661177 True Country Code: 1 National Number: 6502532222 False As you type phone number validation

GitHub Issues

The phonenumbers package has 9 open issues on GitHub

  • Drop mypy version pin
  • Typing Improvement: Use IntEnum for PhoneNumberFormat, PhoneNumberType, etc.

See more issues on GitHub