Get phone number's 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 phonenumbers

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

import phonenumbers
  
# geocoder: to know the specific 
# location to that phone number
from phonenumbers import geocoder
  
   
phone_number = phonenumbers.parse("Number with country code" 
      
# this will print the country name
print(geocoder.description_for_number(phone_number, 
                                      'en'))   


Python program to get the service/network provider name to that phone number
import phonenumbers
  
# carrier: to know the name of 
# service provider of that phone number
from phonenumbers import carrier
  
   
service_provider = phonenumbers.parse("Number with country code")
# Indian phone number example: +91*******

# this will print the service provider name
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

No comments: