Review material for Unit3 Sprint3
We will retrieve weather information from https://openweathermap.org/.
- Go to the Open Weather Map website and register (for free):
- Once logged in, go to https://home.openweathermap.org/api_keys in order to copy your API key (edited)
- There a number of available APIs there, but we will just concentrate ONE CALL API
- Minimum installations:
pip install Flask Flask-SQLAlchemy requests
- You should create your own
.py
file to house your solution. - A sample implementation is in
weather.py
. It is preferable that you do not access it until you create your own solution. - Choose an API call that will only require for
lat
,lon
andapi key
Location to search: Use the following variables to search
- lat = "48.208176"
- lon = "16.373819"
Tasks:
- A. Create an endpoint (main route) that shows the information provided (if in dictionary, this means the keys)
Note: Answer should be something like this:
['dt', 'sunrise', 'sunset', 'temp', 'feels_like', 'pressure', 'humidity', 'dew_point', 'wind_speed', 'wind_deg', 'weather', 'clouds', 'pop', 'uvi']
- B. Create another endpoint ('/results') that shows the first 3 results of "DAILY"
- C. Create a database that stores the following information
- a. id
- b. clouds
- c. humidity
- d. pressure
- D. Create a query from database at this endpoint ('/query') that returns the data from the database.
Thanks to the following participants and contributors: Elizabeth, Victoria, Justin, Rassamy, Micah, Drew, Henry, Ik, Jacob, Antony, Nathan, Marcos