A python library to access the Awattar Energy Price API.
Project description
green_energy
A python library to access the Awattar Api. Refer also to the Awattar Energy Price API. This repo provides functionality for:
- Getting Energy Price forecast information.
Installing the library locally
Python 3 is recommended for this project.
python -m pip install -e .
This is needed for the first time when working with the library/examples/tests.
Example usage
ENERGY_DATA_API_URL="https://api.awattar.de" python3 examples/simple.py
or
from green_energy_api.green_energy_api import GreenEnergyApi
green_energy_api = GreenEnergyApi('provide_api_url')
# or you can define additional optional parameters
# green_energy_api = GreenEnergyApi('provide_api_url', timeout=10)
print(green_energy_api.get_electricity_price())
Development
Installing required pip packages
python pip install -r requirements.txt
pre-commit install -t pre-push
Linting
pylint green_energy_api/*.py tests/*.py examples/*.py
Unit testing
pytest tests/*.py
# show logs
pytest -o log_cli=true
# code coverage
pytest --durations=10 --cov-report term-missing --cov=green_energy_api tests
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
green_energy-0.1.0.tar.gz
(16.3 kB
view details)
Built Distribution
File details
Details for the file green_energy-0.1.0.tar.gz
.
File metadata
- Download URL: green_energy-0.1.0.tar.gz
- Upload date:
- Size: 16.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3746366db851b78148b0ad2a10372907203e24c6031aa3b09ea0cf0eed175535 |
|
MD5 | f01ef557473813db0e6f8ff934f6ebcc |
|
BLAKE2b-256 | 24ddeb09f570ef725bed2c911707c9d87450626c42dba687b3e06012dd56adf5 |
File details
Details for the file green_energy-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: green_energy-0.1.0-py3-none-any.whl
- Upload date:
- Size: 17.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 428774e718ffa6c4578f425bb1610bb3c4692cca39ae1c3c03ec81a67f1ba28f |
|
MD5 | b3a04b532e110b39ba6f477c95883e34 |
|
BLAKE2b-256 | ae431bc3b162a06c5640b03cf72b367db497d043310aa1be6b13efc6ae35878a |