Code Monkey home page Code Monkey logo

cycling_forecast's Introduction

Cycling Forecaster

Setup

  • pip3 install requirements.txt
  • Grab your OAuth 2.0 Client IDs client_secret_XXX.json for your Google account from https://console.cloud.google.com/apis/credentials (you will need to create a new project) , and place it into the main directory. This is the account that the forecaster will send emails from and to.
  • Sign up for the https://openweathermap.org/ API, and note your API key.
  • Make sure to set a request limit at OpenWeatherMap below 2000 daily requests, so you are not charged!. The Cycling Forecaster needs no more than 1 request a day.

Tinkering

The cycling_forecast/constants.py contains some configuration options to customize your forecasting, and adjust how various weather attributes are scored. Use python3 cycling_forecast.py --plot_metrics to view how the suitability scores for wind, temperature, and precipitation, and adjust the constants as desired.

Usage

To run as a daemon:

nohup python3 cycling_forecast.py -k ${OPENWEATHER_API_KEY} -e ${EMAIL_ADDRESS} &

This will continue running, sending a forecast once a day at the specified time. To run just once, immediately:

python3 cycling_forecast.py -k ${OPENWEATHER_API_KEY} -e ${EMAIL_ADDRESS} --now

Arguments

  • -k, --api_key: Specify your OpenWeatherMap api key
  • -e, --email: Specify the email address to send predictions to
  • --plot_metrics: Plot the suitability metrics across a variety of weather conditions
  • --now: Run and send the forecast immediately, then quit.

Default Weather Scoring

Metric scores are computed for rainfall, windspeed, and temperature; these individual scores are then multiplied together. The plots below show the individual metric components for a variety of plausible weather conditions, and the red lines indicate user-configurable parameters. img

cycling_forecast's People

Contributors

robgeada avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.