Skip to content

Latest commit

 

History

History
100 lines (60 loc) · 2.41 KB

README.md

File metadata and controls

100 lines (60 loc) · 2.41 KB

weather_forecast

A python script which displays weather data of the location given by the user as a desktop notification

Libraries used

  • requests
  • notify-py

Prerequisites

Make an account on OpenWeather for the weather API and KEY

Read documentations about

requests

notify-py

open weather API

Run locally

You will need to install python on you system, head over to this link: https://www.python.org/downloads/ for download python

(Dont forget to tick Add Python to PATH while installing python)

Once you have downloaded Python on your system, run the following command inside your terminal (only if your system is git enabled, otherwise download the zip file and extract it)

  git clone https://github.com/milan-sony/weather_forecast.git

Then go to the project folder

  cd weather_forecast

(This is optional, but strongly recommended) Make a virtual environment

  python -m venv venv

Then activate the virtual environment

  venv/Scripts/activate

If error occurs when activating virtual environment, run the following command

  Set-ExecutionPolicy Unrestricted

or

  Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted

Install the dependencies needed for this project

  pip install -r requirements.txt

Now paste your OpenWeather API KEY inside the secret.py file

Then run the script

  python main.py

Working

When you run the script it will ask your location (Please try to give a major city name as your location), then it will check whether that given location is available on not on OpenWeather

It the location is found, it will make a popup windows notification for each 15 min showing the current weather details of the location you have given

Points to be noted

You can change the notification details, Weather API and all as per your need

There may be some faults while running the program (If any error occurs exit the code ctrl + c and run again python main.py)

Future updates

  • Add weather alerts
  • Make the program run on background
  • WebApp