cgmafia / WeatherIndexer

Python + Flask based API check and evaluator for weather comparison

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Test to check the weather

This API respose has been developed according to the requirement I have taken the index city as Cologne for rival comparison

Requirements & Installation

  • Python 3.9+
  • Flask
  • Pytest

Steps to install

  1. Make sure you have Python 3.9 and above installed
  2. cd to this directory
  3. create a .env file in the root with following parameters:
    OpenWeatherAPI=http://api.openweathermap.org/data/2.5/weather
    API_KEY=Your API key
    INDEX_CITY = City you want to index with
  1. To install all the requirements, run pip install -r requirements.txt
  2. To run the API run python api.py
  3. To run tests run python -m pytest

Endpoints

Response

REST API with Json response looks like this

{
    "check": true,
    "criteria": {
        "daytemp": false,
        "naming": true,
        "rival": true
    }
}

About

Python + Flask based API check and evaluator for weather comparison


Languages

Language:Python 100.0%