Get Info of Phone Number using Python With Source Code

Get Info of phone number using python

Hello Curious Coders,

In this project we are going to work on another python predefined library named “phonenumbers” which helps us to extract the information of a phone number like carrier(service provider name) , region it belongs to etc,.Let’s get into it…

Source Code :

Get Discount on Top Educational Courses

Brand NameDiscount InformationCoupon Codes Link
Educative.io20% discount on Educative courses and plans
W3Schools20% discount on W3Schools courses
KodeKloud10% discount on KodeKloud courses and plans
GeeksforGeeks30% discount on GeeksforGeeks courses
Target Test Prep20% discount on Target Test Prep
Coding Ninjas₹5000 discount on Coding Ninjas courses
Skillshare40% discount on Skillshare
DataCamp50% discount on DataCamp
365 Data Science57% discount on 365 Data Science Plans
Get SmarterFlat 20% discount on Get Smarter courses
SmartKeedaFlat 40% discount on SmartKeeda courses
StackSocial20% discount on StackSocial courses
				
					import phonenumbers
from phonenumbers import carrier, geocoder, timezone
mobileNo=input("Enter Phone number with country code(+xx xxxxxxxxx):")
mobileNo=phonenumbers.parse(mobileNo)
if phonenumbers.is_valid_number(mobileNo):
    print('Phone Number belongs to region :',timezone.time_zones_for_number(mobileNo))
    print('Service Provider : ',carrier.name_for_number(mobileNo,"en"))
    print('Phone number belongs to country : ',geocoder.description_for_number(mobileNo,"en"))
else:
    print("Please enter valid mobile number")
				
			

Output :

Get Info of phone number using Python

Code Explanation:

  • First we installed phonenumbers package in our local system.
  • Next we import installed package
  • Later we have taken input as mobile number from user and parsed throug it.
  • Then we checked whether the mobile number is valid or not. If valid we extracted information about it and displayed on the console.

Find More Projects

Auto Text Effect Animation Using Html CSS & JavaScript Introduction Hello friends, welcome to today’s new blog post. Today we have created …

Windows 12 Notepad Using Python Introduction: In this article, we will create a Windows 12 Notepad using Python. If you are a …

Animated Search Bar using Html CSS And JavaScript Introduction Hello friends, all of you developers are welcome to today’s beautiful blog post. …

Best Quiz Game Using HTML CSS And JavaScript Introduction Hello coders, welcome to another new blog. Today in this article we’ll learn …

Tower Blocks Game Using HTML CSS And JavaScript Introduction Hello coders, welcome to another new blog. Today in this blog we’ll learn …

Typing Speed Test Game using Python Introduction: In this article, we will create a Typing Speed Test Game using Python and Tkinter. …

Get Huge Discounts
More Python Projects