APIs/Data Structures

MISSION PART ONE: Getting data

Using the Dark Sky Forecast API at https://developer.forecast.io/, generate a sentence that describes the weather that day.

Right now it is TEMPERATURE degrees out and SUMMARY. Today will be TEMP_FEELING with a high of HIGH_TEMP and a low of LOW_TEMP. RAIN_WARNING.

TEMPERATURE is the current temperature
SUMMARY is what it currently looks like (partly cloudy, etc - it's "summary" in the dictionary). Lowercase, please.
TEMP_FEELING is whether it will be hot, warm, cold, or moderate. You will probably use HIGH_TEMP and your own thoughts and feelings to determine this.
HIGH_TEMP is the high temperature for the day.
LOW_TEMP is the low temperature for the day.
RAIN_WARNING is something like "bring your umbrella!" if it is going to rain at some point during the day.

In [8]:
import requests
response = requests.get('https://api.forecast.io/forecast/2720ff846cb70aeec085c402d31c3ea2/40.7128,-74.0059')
data = response.json()

In [9]:
data.keys()


Out[9]:
dict_keys(['latitude', 'currently', 'longitude', 'timezone', 'daily', 'hourly', 'flags', 'minutely', 'offset'])

In [23]:
#TEMPERATURE is the current temperature

TEMPERATURE = data['currently']['temperature']

In [ ]:
print("Right now it is", TEMPERATURE, "degrees")