1.6 KiB
1.6 KiB
weather_api
Overview
This API serves as a backend system for managing the location of the Open Meteo Weather dashboard. It includes functionalities for creating, updating, deleting and searching available locations.
Endpoints
- GET /locations:
- Retrieve a list of all the locations stored in the database.
- The locations configured by the user
- GET /locations/{id}:
- Retriev weather data for the specified ID.
- POST /locations: Add a new location to the database.
- DELETE /locations/{id}:
- Delete a location with the specified ID.
- GET /location/search:
- Get available locations from Open Meteo using the Geolocation API they provide
Database Integration
- Implemented SQLAlchemy connection with a Postgres database.
- Implemented Models:
- Location` model with id, name, latitude, and longitude.
- Users model with
- Database Tables:
- locations
- For location storing
- users:
- Prototype table for user information
- config:
- Storing of user selected locations for the Dashboard
- locations
Installation
To run the API locally, follow these steps:
- Clone the repository.
- Deploy and activate a venv
- Install the necessary dependencies by running
pip install -r requirements.txt
. - Set up the database connection in the
config.py
file. - Run the application by executing
uvicorn main:app --reload
.
- Or you can use the Dockerfile for creating a docker image.
- Also there is a public image at git.argideli.com/argideli/weather_api:latest