Metadata-Version: 2.1
Name: elvia
Version: 0.0.4
Summary: Python bindings for the Elvia API
Home-page: https://github.com/andersem/elvia-python
Author: Anders Emil Salvesen
Author-email: andersems@gmail.com
License: MIT
Project-URL: Bug Tracker, https://github.com/andersem/elvia-python/issues
Project-URL: Documentation, https://github.com/andersem/elvia-python
Project-URL: Source Code, https://github.com/andersem/elvia-python
Keywords: electricity
Platform: UNKNOWN
Classifier: Development Status :: 1 - Planning
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.6
Description-Content-Type: text/markdown
Provides-Extra: dev
License-File: LICENSE

# Unofficial API bindings for Elvia's consumer facing APIs

![Build Status](https://github.com/andersem/elvia-python/actions/workflows/ci.yml/badge.svg)

With the Elvia API you can access information about your own power consumption and get the
current grid tariffes in Elvia's power grid. 

## Installation

Install from pip by using:

```
pip install --upgrade elvia
```

### Requirements

* Python 3.6+

## Using the SDK

Make sure you are using Elvia and have access:

Get token using this guide: https://www.elvia.no/smart-forbruk/alt-om-din-strommaler/slik-gjor-du-det-aktivering-og-bruk-av-elvias-metervalueapi/

Use your newly created token to get metering values:

```python
from elvia import Elvia
import json
import asyncio

token = "token from elvia.no"

elvia = Elvia(token)

async def get_meter_values():
    meter_value_client = elvia.meter_value()

    print(json.dumps(meter_value_client.get_meter_values(
        {
            "start_time": "2021-12-08T01:00:00",
            "end_time": "2021-12-08T02:00:00",
            "metering_point_ids": ["abc"],
            "include_production": True
        })))
asyncio.run(get_meter_values())
```


