DEV Community

Satyam Kumar Verman
Satyam Kumar Verman

Posted on

Get Phone Number Information using Python

Hello guys this is Satyam,again back with another awesome blog and in this blog I am going to discuss about a module in Python that is called phonenumbers which can be used find out some information about a given phone number such as the Operator Name and the name of the country in which the number is active.

In order to use these module first of all you have to install it using pip package manager because it's not a standard package so you have to install it separately.Type the following command in your terminal or cmd to install this module.

 pip install phonenumber
Enter fullscreen mode Exit fullscreen mode

Python program to get the country name to which phone number belongs:

CODE:
import phonenumbers
from phonenumbers import geocoder
phone_number = phonenumbers.parse("Number with country code")

print(geocoder.description_for_number(phone_number,

'en'))

Python program to get the service/network provider name to that phone number

CODE:
import phonenumbers

from phonenumbers import carrier

service_provider = phonenumbers.parse("Number with country code")
print(carrier.name_for_number(service_provider,
'en'))

Buy Siteground Web hosting:

https://www.siteground.com/index.htm?afcode=4bbbeb6048f7d8fd1efec76817755662

Teestring Merchandise:

https://teespring.com/get-coder-s?pid=328&cid=6277&sid=front

πŸ‘‰Social

Facebook Page:https://www.facebook.com/Bestpythontutorialscom-107219717832080/

My website:https://bestpythontutorials.com

My blogs:https://devtipsntricks.com

Personal Instagram:https://instagram.com/satyamkumarverman

BestPythonTutorials.com Instagram:

https://instagram.com/skvprogrammer

Personal Twitter:https://twitter.com/skvprogrammer

BestPythonTutorials.com Twitter:

https://twitter.com/bestpythontuto1

DevTipsNTricks.com Twitter:

https://twitter.com/devtipsntricks

Facebook(for freelance):

https://facebook.com/satyam.varman.12

Facebook:https://facebook.com/satyam.varman.5

Patron:https://patreon.com/SkvProgrammer

Top comments (0)