Skip to main content

A python library to access the Awattar Energy Price API.

Project description

Awattar 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 awattar_api.awattar_api import AwattarApi

awattar_api = AwattarApi('provide_api_url')
# or you can define additional optional parameters
# awattar_api = AwattarApi('provide_api_url', timeout=10)

print(awattar_api.get_electricity_price())

Development

Installing required pip packages

python pip install -r requirements.txt
pre-commit install -t pre-push

Linting

pylint awattar_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=awattar_api tests

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

smart-energy.awattar-api-0.2.0.tar.gz (16.0 kB view details)

Uploaded Source

Built Distribution

smart_energy.awattar_api-0.2.0-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

Details for the file smart-energy.awattar-api-0.2.0.tar.gz.

File metadata

File hashes

Hashes for smart-energy.awattar-api-0.2.0.tar.gz
Algorithm Hash digest
SHA256 b27f74c539fbd702ba9364094dfffdbd666f8b0909e00e57a3ff34811c3c0088
MD5 c7d8211e49608009510298fc42978c7f
BLAKE2b-256 d1c53cc69a183f928fadfd7f0066adf781de34addf8d7566b76ebcd472efe1fd

See more details on using hashes here.

File details

Details for the file smart_energy.awattar_api-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for smart_energy.awattar_api-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8acad2a5f58914e55a4c6c0306e92383eb315d73860a77ce7b3c2d121793b6eb
MD5 9b8e5842013261d0d4d2f6e8cef499b4
BLAKE2b-256 00518733aa0a62bf3ff4aa02c45e1bccb961bef734f1b44ebcdeb97bd074e639

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page