openweathermap org provides real-time weather information in json format first you must sign up for free api key on the site (this key is used to limit how frequently you make requests on their serverto keep their bandwidth costs down your program simply has to download the page at openweathermap org/data/ /forecast/daily? =&cnt= &appid=<api key>where is the name of the city whose weather you want and is your personal api key add the following to getopenweather py #python getopenweather py prints the weather for location from the command line --snip-download the json data from openweathermap org' api url ='appidresponse requests get(urlresponse raise_for_status(uncomment to see the raw json text#print(response texttodoload json data into python variable we have location from our command line arguments to make the url we want to accesswe use the % placeholder and insert whatever string is stored in location into that spot in the url string we store the result in url and pass url to requests get(the requests get(call returns response objectwhich you can check for errors by calling raise_for_status(if no exception is raisedthe downloaded text will be in response text step load json data and print weather the response text member variable holds large string of json-formatted data to convert this to python valuecall the json loads(function the json data will look something like this{'city'{'coord'{'lat' 'lon'- }'country''united states of america''id'' ''name''san francisco''population' }'cnt' 'cod'' ''list'[{'clouds' 'deg' 'dt' 'humidity' 'pressure' working with csv files and json data