Restoroo/core/helpers/geo.py
2022-08-04 17:58:57 +02:00

9 lines
No EOL
257 B
Python

from geopy.geocoders import Nominatim
from restoroo.const import USER_AGENT
def get_coords_for_address(*address):
nominatim = Nominatim(user_agent=USER_AGENT)
nominatim.geocode(", ".join(*address))
return location.latitude, location.longitude