GithubHelp home page GithubHelp logo

forecast's Introduction

Fore!Cast

Description

Fetches the weather and let's you know whether you can go golfing or not.

Uses a provided location, or if no location is provided it defaults to IP address geolocation. This default is not very accurate, and may get a city near you but not your exact location.

screenshot

API Requirements

Requires a WeatherAPI free tier key to use.

It will ask for your API key if it doesn't detect one in a .env file. The provided key will be written to the WEATHER_API_KEY variable in a .env file at the root of the project.

Installing

This project was written in Python 3.10.7, so you must have at least Python version 3.10.7 installed before proceeding.

You can check your current Python version with the command

python --version

Clone this project to a directory of your choice

git clone https://github.com/nronzel/forecast.git

Move into the cloned project directory

cd forecast

Run the program with

python main.py

You may need to run it using python3 explicitly if you get errors with the above command

python3 main.py

How to Use

You will be prompted for an API key if none is found in the root project directory in an .env file. The provided key will be written to a .env file under the variable WEATHER_API_KEY. It will use this API key to load the fetcher to fetch the data.

A prompt will be printed to the console showing the weather forecast and a message about if you should go golfing depending on the weather.

How It Works

Scores are given to each weather condition on a scale of 1 - 10, with 10 being the most favorable conditions and 1 being horrible conditions. These scores are used to evaluate an overall score for the day and based on that overall score, a response is printed out.

Testing

You can run the current test suite with

python tests.py -v

Future Features

  • Specialized messages based on what weather conditions suck for the day

TODO:

  • Input Sanitization for location & api key
  • Finalize the output
  • Revisit the phrases one more time and refine
  • Refactor the current code as it is

forecast's People

Contributors

nronzel avatar

Stargazers

 avatar

Watchers

 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.