This API respose has been developed according to the requirement I have taken the index city as Cologne for rival comparison
- Python 3.9+
- Flask
- Pytest
- Make sure you have Python 3.9 and above installed
- cd to this directory
- 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
- To install all the requirements, run
pip install -r requirements.txt
- To run the API run
python api.py
- To run tests run
python -m pytest
REST API with Json response looks like this
{
"check": true,
"criteria": {
"daytemp": false,
"naming": true,
"rival": true
}
}