Skip to content

Cycling A to B, what's the weather every hour along the route?

Notifications You must be signed in to change notification settings

dfinnis/RainyDay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RainyDay

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!

Getting Started

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.

Examples

image of correct output

image of correct output2

Protections

I protected against invalid city names:

image of Invalid city name

I protected against problems associated with cycling too far in a day:

image of Paris-Dubai

I also protected against problems associated with cycling across large bodies of water:

image of Paris-Toronto

Approach

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.

API requests

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!

About

Cycling A to B, what's the weather every hour along the route?

Topics

Resources

Stars

Watchers

Forks

Languages