Python 3 Script to Get Mobile Number Country Name and Service Provider Information Using phonenumbers Module

Python 3 Script to Get Mobile Number Country Name and Service Provider Information Using phonenumbers Module There may be many doubts when it comes to this article. We hope that after reading this article all doubts will be resolved. Let’s go to the article.

Python 3 Script to Get Mobile Number Country Name and Service Provider Information Using phonenumbers Module

Python 3 Script to Get Mobile Number Country Name and Service Provider Information Using phonenumbers Module

import phonenumbers

# geocoder: to know the specific
# location to that phone number
from phonenumbers import geocoder


phone_number = phonenumbers.parse("Number with country code")
# Indian phone number example: +91**********
# Nepali phone number example: +977**********

    
# this will print the country name
print(geocoder.description_for_number(phone_number,
                                    'en'))
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**********
# Nepali phone number example: +977**********

    
# this will print the service provider name
print(carrier.name_for_number(service_provider,
                            'en'))

Read Also: Python 3 Tkinter GUI Script to Ping the Website Server Host Using pythonping Module

Final Words

Python 3 Script to Get Mobile Number Country Name and Service Provider Information Using phonenumbers Module We hope all your doubts about this topic will be resolved. See you again in the next article Thank you.

Hi, I'm Selva a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Deekshi. Here, I post about programming to help developers.

Share on:

Leave a Comment