Sunday, 24 October 2021

Get Phone Number Details Using Python

 Get Phone Number Details Using Python

    1. Import Python module PHONENUMBERS using command "pip install phonenumbers" in you CLI
    2. Then copy and paste or write by your hand for practice the following code
    3. import phonenumbers
      from phonenumbers import carrier, geocoder, timezone

      mobileNo = input("Enter Mobile Number with country Code: ")
      mobileNo = phonenumbers.parse(mobileNo)

      # get timezone a phone number
      print(timezone.time_zones_for_number(mobileNo))

      # get carrier of a phone number
      print(carrier.name_for_number(mobileNo, "en"))

      # Getting region information
      print(geocoder.description_for_number(mobileNo, "en"))

      # validating a phone number
      print("Valid Mobile Number :",phonenumbers.is_valid_number(mobileNo))

      #checking possibility of a number
      print("Checking possibility of Number :",phonenumbers.is_possible_number(mobileNo))


       
    4.  After that simply execute the program and enter the Phone number with country code and you will get the details.
    5. Thanks Happy Coding.....👩‍💻👨‍💻

No comments:

Post a Comment

Get Phone Number Details Using Python

 Get Phone Number Details Using Python Import Python module PHONENUMBERS using command " pip install phonenumbers" in you CLI Then...