In this article, you will learn how you can get the information about phone number like the country name to which the phone number belongs to, or the network service provider name of that phone number just by writing a simple Python program. Python provides a module name phonenumbers for this task. This article is Python’s port of Google’s libphonenumber library.
Install the package
phonenumbers using the below command in your command prompt.
pip install phonenumbers
Example 1: Python program to get the country name to which phone number belongs:
Example 2: Python program to get the service provider name to that phone number
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.
- Python - Get Hardware and System information using platform module
- Get Your System Information - Using Python Script
- Get latest Government job information using Python
- Build an GUI Application to Get Live Air Quality Information Using Python.
- How to get real-time Mutual Funds Information using Python?
- Converting a 10 digit phone number to US format using Regex in Python
- Get all the information of a Collection's indexes using PyMongo
- Create a GUI to Get Domain Information Using Tkinter
- Send SMS updates to mobile phone using python
- PyQt5 - Create a User form to get information
- Create a GUI to Extract information from VIN number Using Python
- View Computer's Important Network Information Using Python
- Create a GUI to search bank information with IFSC Code using Python
- Extract Author's information from Geeksforgeeks article using Python
- Scraping Amazon Product Information using Beautiful Soup
- Python IMDbPY – Series Information in XML format
- Python IMDbPY – Company Information in XML format
- Python IMDbPY – Person Information in XML format
- Python IMDbPY – Movies Information in XML format
- PyQt5 QSpinBox - Dumping object information
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.