In [ ]:
import pandas
from gasp.fromapi.weather.endpoints import geolookup_by_position
from gasp.fromapi.weather.endpoints import geolookup_by_name

In [ ]:
lat, lng = str(42 + (12/60.0) + (33.99/3600)), str(-(8 + (25 /60.0) + (10.90/3600)))
a = geolookup_by_position(lat, lng)

In [ ]:
b = geolookup_by_name("coimbra", "pt")

In [ ]:
df1 = pandas.DataFrame([[
    a['location']["city"], a['location']["country_name"],
    a['location']['lat'], a['location']['lon']
]], columns=["city", "country", "lat", "lon"])

print df1

In [ ]:
p = pandas.DataFrame(a['location']['nearby_weather_stations']['airport']['station'])

print p

In [ ]:
pws = pandas.DataFrame(a['location']['nearby_weather_stations']['pws']['station'])
print pws

In [ ]:
print b
print b['location']['nearby_weather_stations']

In [ ]:
mainDf = df1.append(p, ignore_index=True)
mainDf = mainDf.append(pws, ignore_index=True)

In [ ]:
print mainDf

In [ ]: