September 2019
Beginner
456 pages
10h 53m
English
In this section, we will retrieve our final data element: the weather. As mentioned earlier, we will use the Dark Sky service, which allows us to gather historical weather reports for any place in the world. The weather API is REST and JSON-based, so we'll use the urllib module to request data and the json library to parse it. Of note in this section is that we cache the data locally, so you can run the script offline for testing if need be. Early on in this section is where you place your Dark Sky API key that is flagged by the YOUR KEY HERE text. Let's have a look at the following steps:
log.info("Creating weather summary")# Get the bounding box centroid for georeferencing ...