smart_energy.green_energy_api
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 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
Release files for smart-energy.green-energy-api 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| smart_energy.green_energy_api-0.1.0.tar.gz | 15.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| smart_energy.green_energy_api-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 31.0 kB
Release files / smart_energy.green_energy_api-0.1.0.tar.gz
| Download URL | smart_energy.green_energy_api-0.1.0.tar.gz |
|---|---|
| Size | 15.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
50afd9d282ce58e2f97f24cece318b3ceefcaf7260666cc06fbfbf4d0ed967ef
|
|
BLAKE2b-256 checksum How to use checksums |
7c5faa891845ed419e854f1d35a690b2e5657152c976571605c31d1b652496d7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.11.1
|
Release files / smart_energy.green_energy_api-0.1.0-py3-none-any.whl
| Download URL | smart_energy.green_energy_api-0.1.0-py3-none-any.whl |
|---|---|
| Size | 15.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
378299cc9711c3ddb48096cb7d44949ca41da4c37c7d27c55eefe04bf8c87074
|
|
BLAKE2b-256 checksum How to use checksums |
9a6e77442a6dc3053a2ec72c8ec8fc3eef51b7dd0273b8cf878e9d7065221219
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.11.1
|