-
Notifications
You must be signed in to change notification settings - Fork 206
/
main.py
47 lines (33 loc) · 1.32 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import phonenumbers
from phonenumbers import geocoder
from key import keys
number = input("Enter phone number with country code:")
check_number = phonenumbers.parse(number)
number_location = geocoder.description_for_number(check_number, "en")
print(number, " : ", number_location)
from phonenumbers import carrier
service_provider = phonenumbers.parse(number)
print("Service provider : ",carrier.name_for_number(service_provider, "en"))
from opencage.geocoder import OpenCageGeocode
geocoder = OpenCageGeocode(keys)
query = str(number_location)
results = geocoder.geocode(query)
lat = results[0]['geometry']['lat']
lng = results[0]['geometry']['lng']
timezone = results[0]['annotations']['timezone']['name']
currency_name = results[0]['annotations']['currency']['name']
currency_symbol = results[0]['annotations']['currency']['symbol']
flag = results[0]['annotations']['flag']
print("Time-Zone : ",timezone)
print("Currency : ",currency_name)
print("Symbol : ",currency_symbol)
print("latitude: ",lat)
print("longitude: ",lng)
import folium
map_location = folium.Map(location = [lat,lng], zoom_start=8)
folium.Marker([lat,lng], popup=number_location).add_to(map_location)
map_location.save("mylocation.html")
import webbrowser
# here insert the relative path of your mylocation.html file
url = " realtive path "
webbrowser.open_new(url)