Skip to content

Python tool to check location, carrier, country, and validity of a phone number using phonenumbers.

Notifications You must be signed in to change notification settings

FahryIbrahim/Find-Phone-Number-Location_with_Python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

English:


Phone Number Validation Program with Python

This program aims to provide detailed information about a phone number. By utilizing the phonenumbers library, the program can furnish details such as the location (timezone) of the number, service provider, country of origin, as well as validate and check the feasibility of the number.

How to Use:

  1. Ensure you have installed the phonenumbers library.

    Installation via pip:

    pip install phonenumbers
  2. Run the program and enter the phone number when prompted.

  3. The program will display the following information:

    • Location (Timezone)
    • Service provider
    • Country of origin
    • Phone number validation
    • Possibility of the number

Code Breakdown:

  • Import necessary libraries:

    import phonenumbers
    from phonenumbers import carrier, geocoder, timezone
  • Prompt user to input the phone number:

    mobileNo = input("Enter Phone Number: ")
    mobileNo = phonenumbers.parse(mobileNo)
  • Display related information of the number:

    print(timezone.time_zones_for_number(mobileNo))
    print(carrier.name_for_number(mobileNo, "en"))
    print(geocoder.description_for_number(mobileNo, "en"))
    print("Valid Mobile Number: ", phonenumbers.is_valid_number(mobileNo))
    print("Checking the possibility of a number: ", phonenumbers.is_possible_number(mobileNo))

Note: Here "en" refers to the language code for English. For other languages, replace "en" with the appropriate language code.


Bahasa Indonesia:


Program Validasi Nomor Telepon dengan Python

Program ini bertujuan untuk memberikan informasi detil dari sebuah nomor telepon. Dengan memanfaatkan library phonenumbers, program dapat memberikan informasi seperti lokasi (timezone) dari nomor tersebut, provider layanan, negara asal, serta memvalidasi dan memeriksa kemungkinan dari nomor tersebut.

Cara Menggunakan:

  1. Pastikan Anda telah menginstal library phonenumbers.

    Instalasi via pip:

    pip install phonenumbers
  2. Jalankan program dan masukkan nomor telepon saat diminta.

  3. Program akan menampilkan informasi tentang:

    • Lokasi (Timezone)
    • Provider layanan
    • Negara asal
    • Validasi nomor telepon
    • Kemungkinan dari nomor tersebut

Penjelasan Kode:

  • Mengimport library yang diperlukan:

    import phonenumbers
    from phonenumbers import carrier, geocoder, timezone
  • Meminta pengguna untuk memasukkan nomor telepon:

    mobileNo = input("Masukkan Nomor HP: ")
    mobileNo = phonenumbers.parse(mobileNo)
  • Menampilkan informasi terkait nomor tersebut:

    print(timezone.time_zones_for_number(mobileNo))
    print(carrier.name_for_number(mobileNo, "id"))
    print(geocoder.description_for_number(mobileNo, "id"))
    print("Valid Mobile Number: ", phonenumbers.is_valid_number(mobileNo))
    print("Mengecek posibilitas sebuah nomor: ", phonenumbers.is_possible_number(mobileNo))

Catatan: Di sini "id" merujuk pada kode bahasa untuk Indonesia. Untuk bahasa lain, Anda bisa mengganti "id" dengan kode bahasa yang sesuai.


Semoga bermanfaat! Jika Anda memiliki pertanyaan atau memerlukan bantuan lebih lanjut, jangan ragu untuk bertanya.

Releases

No releases published

Packages

No packages published

Languages