Skip to main content

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 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 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)

Source distribution for green-energy-api 0.1.0
File Size Uploaded
green_energy_api-0.1.0.tar.gz 16.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for green-energy-api 0.1.0
File Interpreter ABI Platform
green_energy_api-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 33.5 kB

Release files / green_energy_api-0.1.0.tar.gz

Download URL green_energy_api-0.1.0.tar.gz
Size 16.2 kB
Tags Source
SHA-256 checksum
How to use checksums
300c336c03e7c6a6b8ef8a0cba686a9ba6fdea1b69908f9d09efaeb43a273331
BLAKE2b-256 checksum
How to use checksums
b02d0bdc56d300b4ac39bd12d5e92a802daa4750150bc2ac23b7c580f93426f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.1

Release files / green_energy_api-0.1.0-py3-none-any.whl

Download URL green_energy_api-0.1.0-py3-none-any.whl
Size 17.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e7117ba713ea731039e84a17463aa2b047587102708682a7e5b9a01c7aa4d64e
BLAKE2b-256 checksum
How to use checksums
d387b15f36056e9cdc73f85fdfc02d624390802bec0b8282086fb461dab94a9f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.1

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page