This application provides API for different usecases (Electricity).
- Retrieve electricity prices for a specified time range and store it into a SQLite DB.
- Fetch missing data from an external source (ENTSO-E API).
- Find the cheapest consecutive or non-consecutive hours.
- Find the current price.
- Calculate the hourly price ratio to daily average
- Python 3.8+
- Docker (optional, for Docker usage)
-
Clone the repository:
git clone https://github.com/kasperiio/api.git cd api
-
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the dependencies:
pip install -r requirements.txt
-
Start the application:
uvicorn app.main:app --reload
-
Access the API documentation at
http://127.0.0.1:8000/docs
.
-
Modify the docker-compose.yaml to you likeing
-
Build and start the Docker containers:
docker-compose up --build -d
-
Access the API documentation at
http://127.0.0.1:8000/docs
. -
To stop the container:
docker-compose down
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Make your changes.
- Commit your changes (
git commit -m 'Add some feature'
). - Push to the branch (
git push origin feature-branch
). - Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.