{"id":387,"date":"2017-08-04T20:45:10","date_gmt":"2017-08-04T20:45:10","guid":{"rendered":"http:\/\/www.codeastar.com\/?p=387"},"modified":"2018-02-24T20:44:17","modified_gmt":"2018-02-24T20:44:17","slug":"easy-python-weather-forecast-tool","status":"publish","type":"post","link":"https:\/\/www.codeastar.com\/easy-python-weather-forecast-tool\/","title":{"rendered":"Easy Weather Forecast Tool in Python"},"content":{"rendered":"

Since I am going to have a 5-day trip to Sapporo, Hokkaido, Japan at the end of August, I would like to have a weather forecast for my trip.<\/p>\n

“So why don’t you check from a weather forecast site for free?”<\/p>\n

Yes, but I would like to get the exact information that I want to know. And it is easy to do when we do it in Python. Check on web is free, do it yourself is just, priceless<\/em>.<\/p>\n

<\/p>\n

Okay, talk is cheap, let’s do it. Like the time we did the 10 lines fx tool<\/a>, we should keep our code short and simple.<\/p>\n

Planning Stage<\/h3>\n

As we are doing weather forecast operation and we are no weather guys, we need an API and its key to do the weather job for us. Then we have the\u00a0Dark Sky weather API<\/a>. It is fast and simple, and the first 1000 API calls per day are free, it is pretty enough for our weather tool. So just go there to get the API key for free.<\/p>\n

Design the Interface<\/h3>\n

I would like to make a python program with command line user interface. Since it is a weather forecast tool for vacation, we have following things as input parameters:<\/p>\n