Metadata-Version: 2.1
Name: green_energy_api
Version: 0.1.0
Summary: A python library to access the Awattar Energy Price API.
Home-page: 
Author: 
Author-email: Ingmar Mueller <ingmar.mueller@kfw.de>, Mario Macai <mario.macai@accenture.com>, Melissa Schmidt <melissa.schmidt@accenture.com>, Georgia Moldovan <georgia.moldovan@accenture.com>, Felix Stark <felix.stark@kfw.de>
Project-URL: Bug Tracker, https://github.com/openkfw/smart_energy.green_energy_api/issues
Project-URL: Homepage, https://github.com/openkfw/smart_energy.green_energy_api
Keywords: green_energy,kfw,api,cloud
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Operating System :: OS Independent
Provides: green_energy_api
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Provides-Extra: dev
License-File: LICENSE

# green_energy_api

A python library to access the Awattar Api. Refer also to the [Awattar Energy Price API](https://www.awattar.de/). This repo provides functionality for:

- Getting Energy Price forecast information.

## Installing the library locally

Python 3 is recommended for this project.

```bash
python -m pip install -e .
```

> **This is needed for the first time when working with the library/examples/tests.**

## Example usage

```bash
ENERGY_DATA_API_URL="https://api.awattar.de" python3 examples/simple.py
```

or

```python
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

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

### Linting

```bash
pylint green_energy_api/*.py tests/*.py examples/*.py
```

### Unit testing

```bash
pytest tests/*.py

# show logs
pytest -o log_cli=true

# code coverage
pytest --durations=10 --cov-report term-missing --cov=green_energy_api tests
```
