This Python script is a command-line tool designed to retrieve information about a phone number, including its location and carrier details. It leverages the phonenumbers library for parsing and validating phone numbers, the OpenCage Geocoder API for detailed location information, and folium for generating an interactive map of the phone number's approximate location. This tool helps you quickly identify the origin and carrier of a phone number.
- Phone Number Validation: Ensures the entered phone number is in a valid format.
- Location Lookup: Retrieves the geographical location associated with the phone number using the OpenCage Geocoder API.
- Carrier Identification: Identifies the carrier associated with the phone number.
- Interactive Map Generation: Creates an HTML file containing an interactive map showing the phone number's location using
folium. - User-Friendly Output: Displays the location and carrier information in a clear and concise format.
- API Key Handling: Securely retrieves the OpenCage Geocoder API key from environment variables or prompts the user for input.
- Normalization: Normalizes the phone number to international format.
- Programming Language: Python
- Phone Number Parsing & Validation:
phonenumbers - Geocoding API: OpenCage Geocoder
- Map Generation:
folium - Environment Variables:
os - Error Handling:
sys
- Python 3.6 or higher
- An OpenCage Geocoder API key (You can obtain one for free at https://opencagedata.com/)
-
Clone the repository:
git clone <repository_url> cd <repository_directory>
-
Install the required Python packages:
pip install phonenumbers opencage folium
-
Set the OpenCage Geocoder API key as an environment variable:
export API_KEY="YOUR_API_KEY"
Or, you can enter it when prompted by the script.
-
Run the script:
python py.py
-
Enter the phone number when prompted.
-
The script will display the location and carrier information and generate an HTML file named
MyMap.htmlcontaining the map.
After running the script, it will prompt you to enter a phone number. Enter the phone number in any format, and the script will attempt to normalize it to the international format. The script will then display the location and carrier information associated with the phone number. An HTML file named MyMap.html will also be created, which you can open in your browser to view the interactive map.
.
βββ py.py # Main Python script
βββ README.md # Project documentation
Contributions are welcome! Please feel free to submit pull requests or open issues to suggest improvements or report bugs.
If you have any questions or suggestions, feel free to contact me at [farilpratamap@gmail.com] / My instagram @fr.project.id
Thank you for checking out this project! I hope you find it useful.
This is written by readme.ai.