In this article, I will be sharing with you how to track phone numbers of any sim of any country using python just by a typing a few lines of magic."
The task will be done by importing a module called phonenumbers. It is not a pre installed module , so we have to install it using PIP. This is a Python port of Google's libphonenumber library It supports Python 2.5-2.7 and Python 3.x.
Whats the code?
Firstly install and import the prerequisites.
Follow the given steps:-
import phonenumbers
from phonenumbers import geocoder,carrier
numbers= ["+917070190843","+917360022111","+919898666987"]
length = len(numbers)
i= 1
j=0
while i<= length:
for item in numbers:
num= f"phoneNumber{i}"
num = phonenumbers.parse(item)
Carrier = carrier.name_for_number(num, 'en')
Region = geocoder.description_for_number(num,'en')
print("Number: ",numbers[j])
print("Carrier: ",Carrier)
print("Region: ",Region)
print()
print()
i+=1
j+=1
Output
Number: +917070190843
Carrier: Airtel
Region: India
Number: +917360022111
Carrier: Vodafone
Region: India
Number: +918986665159
Carrier: BSNL MOBILE
Region: India
import phonenumbers
from phonenumbers import geocoder,carrier
numbers= ["+917070190843","+917360022111","+919898666987"]
length = len(numbers)
i= 1
j=0
while i<= length:
for item in numbers:
num= f"phoneNumber{i}"
num = phonenumbers.parse(item)
Carrier = carrier.name_for_number(num, 'en')
Region = geocoder.description_for_number(num,'en')
print("Number: ",numbers[j])
print("Carrier: ",Carrier)
print("Region: ",Region)
print()
print()
i+=1
j+=1