I recently twisted my ankle
and during my recovery I was unable to play for awhile. As I dreamed of playing again, my mind turned to the upcoming football training days that might be rainy and with slippery field conditions. Days like those I would not be able to play, but how many possible days might I miss?

Ok, this might look bad in X-ray, but all in all the injury was restricted to only my ligament
Ahhh, I love Python I said to myself. This would be a perfect opportunity to use Python again. I could use it to create a list of all the football training days and weather conditions for those days.
The Plan
Since I’ve always checked wunderground.com for weather updates I decided it would be the perfect place to get weather data. From here I would have to find the weather for every day I have football training (Mondays and Thursdays). After finding the weather for those days I would then print them to a HTML document. Here is the final live webpage, yearly football weather.

Final output, HTML webpage
Weather data

Create a api key to access data
First I had to create a api key in order to access the weather data, which was rather quite and easy to setup from here Wunderground’s documentation on how to access the data was also straight forward. There’s a nifty api testing tool, apigee, this tool allows you to determine what type of weather data you want to access, in my case it was weather history.

Playing around with apigee to get the right weather data

Wunderground provides examples of how to access their data
Parsing and Scripting
After retrieving the data I desired, I then wrote a script to firstly determine the days of the week that I would have football on for the current year. From these days I was able to then query the weather data and save the results to a HTML webpage.

Testing the wunderground api

The script to parse the weather data and generate the HTML webpage – part 1

The script to parse the weather data and generate the HTML webpage – part 2
The final output
With the generation of the HTML webpage one task was left, styling and adding the weather icons to the webpage. For the weather icons Wunderground again has provided a great set of icon sets to chose from, in my case I went with icon set #9 as it was the cleanest looking one. Here again is the webpage live, yearly football weather.
Wunderground is awesome with it’s resources, providing icon sets
I used icon set #9
