Restoroo/core/helpers/geo.py

9 lines
257 B
Python
Raw Permalink Normal View History

2022-08-04 15:58:57 +00:00
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