Metadata-Version: 2.1
Name: aguasgaia
Version: 0.0.21
Summary: Python library to retrieve information from "Aguas de Gaia" portal
Author-email: Jose Rolo <ze.p.rolo@gmail.com>
License: Apache-2.0
Keywords: api,aguasgaia
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: aiohttp
Requires-Dist: python-dateutil

# Aguas de Gaia API

## Installation
```bash
$ pip install aguasgaia
```
## Usage
```python
import asyncio
import aiohttp
from aguasgaia import AguasGaia


async def main():
    session = aiohttp.ClientSession()

    aguas = AguasGaia(session, "<USERNAME>", "<PASSWORD>")
    print("LOGIN: ", await aguas.login())

    print("SUBSCRIPTIONS:\n{0}".format(await aguas.get_subscriptions()))

    inv = await aguas.get_last_invoice()
    print("INVOICE: {0}\n{1}".format(inv.invoice_value, inv.invoice_attributes))

    consumption = await aguas.get_last_consumption()
    print("CONSUMPTION: {0}\n{1}".format(consumption.consumption_value, consumption.consumption_attributes))

    await session.close()

if __name__ == "__main__":
    asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
    asyncio.run(main())
```

## Tests
Make sure pytest asyncio is installed
```bash
$ pip install pytest-asyncio
```
Execute the tests
```bash
$ pytest tests/
```
