When planning a cycle trip for the day, I want to find out what the weather is going to be like.
However, to do this I have to calculate when I will be where, then look up the weather at multiple locations along my route.
Surely there is a better way?!
I built an automated weather forcast for a specified route.
It returns the weather every hour at the location I'll be along the route, easy!
Clone this repo.
git clone https://github.com/dfinnis/RainyDay.git; cd RainyDay
Download dependencies.
pip install -r requirements.txt
Run.
python3 rainyday.py
Then specify origin and destination when prompted.
I protected against invalid city names:
I protected against problems associated with cycling too far in a day:
I also protected against problems associated with cycling across large bodies of water:
Using API requests it's possible to first find the latitude and longitude for a given origin and destination.
Then yournavigation.org returns the route and travel time between origin and destination.
The travel time informs how many hourly 'stops' are necessary.
The location along the route each hour can be found, then finaly the weather on location at the correct time.
BTW: There are only 50 API requests per day available. To get a new API key: register for a free account with accuweather, follow the directions, add an app, and replace the API key in rainyday.py.
Ride safe and stay dry!