Skip to content

A Weather App which fetches data from an API to display weather forecast

License

Notifications You must be signed in to change notification settings

VaibhavBhujade/Weather-or-not

Repository files navigation

WeatherOrNot

Contents of this file

  • Introduction
  • Setup
  • Techstack
  • API used
  • Maintainer

INTRODUCTION

Weather or Not is a simple weather app which fetches data from an API to display current weather forecast of the place chosen in preferred language. Currently three languages are supported. It also gives a three day forecast.

SETUP

Initial Setup

  1. Clone or download the code from the repository.
  2. Navigate to the project folder WeatherOrNot
  3. Install the dependencies by running pip install -r requirements.txt
  4. Install flask pip install flask
  5. Get API key from WeatherAPI.com and assign it in `constants.py

To run

  1. Run command flask run
  2. In your browser go to localhost:5000

Developer mode

To enter into developer mode and debug run the following commands

set FLASK_ENV=development
set FLASK_DEBUG=1
set FLASK_APP=app.py

Testing

Testing is done using the nose framework.

  1. Install the dependencies for testing pip install -r test-requirements.txt
  2. Navigate to the test folder. To run the tests nosetests testsdk.py -v Exception handling and Time to retrieve information is tested. When a user enters invalid place, an exception should be thrown. Since weather updates must be real-time, the time taken to retrieve information is critical.
Test id Test name Test Description Test Input Expected Output Test Result
T01 test_weather_with_invalid_place Exception should be thrown for invalid place entered Place: qqqww, Language= en Exception Thrown Pass
T02 test_forecast_with_invalid_place Exception should be thrown for invalid place entered Place: qqqqq, Language= en Exception Thrown Pass
T03 test_time_Weather Test should pass within time limit <0.9 Executed before 0.9 Pass
T04 test_time_Forecast Test should pass within time limit <0.9 Executed before 0.9 Pass

Screenshots

Sorry!! Couldn't load. Sorry!! Couldn't load. Sorry!! Couldn't load.

TECH STACK

  • python 3.8.3
  • flask 1.1.2
  • HTML5
  • CSS

API used

Powered by WeatherAPI.com

MAINTAINER

This project has been developed in the second round of UBS Avant Garde Engineering Challenge in the time period of seven days. The contributor to the project is :

  • Mr. Vaibhav Bhujade (VaibhavBhujade)

About

A Weather App which fetches data from an API to display weather forecast

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published