-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.py
32 lines (21 loc) · 805 Bytes
/
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
import phonenumbers
import folium
from test import number
from phonenumbers import geocoder
Key = "dca14f2b9b7a4605967cbaaef2d2d99e"
samNumber = phonenumbers.parse(number)
yourLocation = geocoder.description_for_number(samNumber, "en")
print(yourLocation)
from phonenumbers import carrier
service_nmber = phonenumbers.parse(number, "RO")
print(carrier.name_for_number(service_nmber, "en"))
from opencage.geocoder import OpenCageGeocode
geocoder = OpenCageGeocode(Key)
query = str(yourLocation)
results = geocoder.geocode(query)
lat = results[0]['geometry']['lat']
lng = results[0]['geometry']['lng']
print(lat,lng)
myMap = folium.Map(location=[lat, lng], zoom_start = 9)
folium.Marker([lat, lng],popup = yourLocation).add_to((myMap))
myMap.save("myLocation.html")