Get Info of phone number using python

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…

Code

				
					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

library management system using python with source code using Python GUI Tkinter (Graphical User Interface) How to Run the code: Introduction:  Imagine …

Space Shooter Game Using Python with source code Overview: A space shooter game typically involves controlling a spaceship to navigate through space …

Hotel Management System Using Python with source code Introduction: Welcome to our blog post introducing a helpful tool for hotels: the Tkinter-based …

Student Management System Using Python Introduction: The Student Management System is a comprehensive software solution designed to streamline the process of managing …

Billing Management System using Python introduction: The Billing software using python is a simple yet effective Python application designed to facilitate the …

Medical Management System using Python with Complete Source code [By using Flask Framework] Introduction Hospital Management System The Hospital Management System is …

More Python Projects
Get Huge Discounts

All Coding Handwritten Notes

Browse Handwritten Notes