In order to get details of any mobile number. We can use an inbuilt library of python i.e "phonenumbers". And modules present inside this library are "geocoder", "carrier" and "timezone".
Step 1: install the library "phonenumbers"
!pip install phonenumbers
Step 2: import library
import phonenumbers
Step 3: take user's phone number and parse it
a = input("Enter Phone Number: ")
# Parsing
ph_no = phonenumbers.parse(a)
Step 4:
geocoder : this module is used to get the location of your number.
from phonenumbers import geocoder
# Location Of Number
print(geocoder.description_for_number(ph_no,"en"))
Step 5:
carrier : this module is used to get the service_provider's name of your number.
from phonenumbers import carrier
# Service_Provider's Name
print(carrier.name_for_number(ph_no,"en"))
Step 6:
timezone : this module tells the timezone of the phone number.
from phonenumbers import timezone
# Timezone
print(timezone.time_zones_for_number(ph_no))
Full Code : Click Here
Top comments (0)