# %%
import pandas as pd
import googlemaps


gmaps = googlemaps.Client(key='AIzaSyB76EhR4OqjdXHQUiTkHZC0Svx_7cPGqyU')

""" LOAD SPIELSTAETTEN FROM CSV"""

def get_venues():
    venues = pd.read_excel("data/beispieldaten_spielstaetten.xlsx")

    venues = venues.to_dict(orient='records')


    for v in venues:
        geocode_result = gmaps.geocode("Dresden "+v['SB_SPST_NAME'])
        latitude =0
        longitude =0
        if len(geocode_result)>0:
            location = geocode_result[0]['geometry']['location']
            latitude = location['lat']
            longitude = location['lng']

        v['latitude'] = latitude
        v['longitude'] = longitude
        
    return venues

# %%
