From a3fe250870fda3dd3b6433ea7eb128cf6a29ebd6 Mon Sep 17 00:00:00 2001 From: Argiris Deligiannidis Date: Sun, 7 Apr 2024 13:02:52 +0300 Subject: [PATCH] Edit README --- README.md | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0343cb8..95d02b7 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,23 @@ -# weather_api +## weather_api -Datacose Weather API \ No newline at end of file +### Datacose Weather API + +### Database Integration + +- Implement SQLAlchemy with a local Postgres database. +- Design a `Location` model with attributes including id, name, latitude, and longitude. + +### API Endpoints + +- **Manage Locations:** + - `GET /locations`: Retrieve a list of all locations saved in the database, including their current weather conditions. This requires integrating with the [OpenMeteo API](https://open-meteo.com/) to fetch weather data based on latitude and longitude. + - `POST /locations`: Allow adding a new location by providing name, latitude, and longitude. + - `DELETE /locations/{id}`: Enable location deletion by ID. + +- **Weather Forecast:** + - `GET /forecast/{location_id}`: Provide a detailed 7-day weather forecast for a specified location. This endpoint will call the OpenMeteo API to fetch forecast data based on the location's latitude and longitude stored in the database. + + +### API Integration + +- To fetch weather information, you are to use the [OpenMeteo API](https://open-meteo.com/). Given that this API requires latitude and longitude for location data, utilize [this predefined list of locations](https://gist.github.com/ofou/df09a6834a8421b4f376c875194915c9) as your hardcoded source.