BhargavKadali39 / phonenumbers

Python is a very powerful language and also very rich in libraries. Phone numbers are one of the modules that provide numerous features like providing basic information about a phone number, validation of a phone number, etc. Here, we will learn how to use the phone numbers module just by writing simple Python programs. Some of the use cases are, Get Timezone: Here is the simple Python program to get the timezone of a phone number using the phone numbers module. First, we do parse the string input to phone number format, and then we use an inbuilt function to get the timezone of a user. It gives the output for valid numbers only, so do check if there is no relevant output. ex: timezone.time_zones_for_number(mobileNumber) Carrier and Region of a Phone Number: Here we will learn how to find the carrier and region of a phone number using the geocoder and carrier functions of this module. Here we can choose multiple languages to display the result. ex for the carrier: carrier.name_for_number(mobileNumber, "en") ex for region: geocoder.description_for_number(mobileNumber, "hi") Validation of a phone number: A simple python program, to check whether a given phone number is valid or not (e.g. it’s in an assigned exchange), and to check whether a given phone number is possible or not (e.g. it has the right number of digits). ex: phone numbers.is_valid_number (mobileNumber)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BhargavKadali39/phonenumbers Stargazers