track phone number location using python

# install package:
pip install phonenumbers

# code:
import phonenumbers
from phonenumbers import geocoder
from phonenumbers import carrier

number = '+XXXXXXXXXX'
ch_number = phonenumbers.parse(number, "CH")
print(geocoder.description_for_number(ch_number, "en"))
service_provider = phonenumbers.parse(number, "RO")
print(carrier.name_for_number(service_provider, "en"))

Here is what the above code is Doing:
1. We import the phonenumbers module.
2. We import the geocoder module from the phonenumbers module.
3. We import the carrier module from the phonenumbers module.
4. We create a variable called number and assign it a value of +XXXXXXXXXX.
5. We create a variable called ch_number and assign it a value of phonenumbers.parse(number, “CH”).
6. We print the value of geocoder.description_for_number(ch_number, “en”).
7. We create a variable called service_provider and assign it a value of phonenumbers.parse(number, “RO”).
8. We print the value of carrier.name_for_number(service_provider, “en”).