Simple Current Conditions Request Example


from aerisweather.aerisweather import AerisWeather
from aerisweather.requests.RequestLocation import RequestLocation
from keys import client_id, client_secret, app_id

# instantiate our aerisweather object
aeris = AerisWeather(client_id=client_id, client_secret=client_secret, app_id=app_id)

# create a RequestLocation object to be used with any endpoint requests
loc = RequestLocation(city="minneapolis", state="mn")

# create a simple observations request with no options
conditions_list = aeris.conditions(location=loc)

for condition in conditions_list:

    # get some conditions data
    tempF = condition.periods[0].tempF
    weather = condition.periods[0].weather

    print("Simple Conditions Request Example:")
    print("Conditions are currently " + weather + " with a temp of " + str(tempF) + "°F")

Expected output:

Simple Conditions Request Example:
The current weather for minneapolis, mn:
Conditions are currently Mostly Cloudy with a temp of 65°F

*The actual values may vary

Last modified: February 03, 2022