Python library to retrieve information from "Aguas de Gaia" portal
Project description
Aguas de Gaia API
Installation
pip install .
Usage
import asyncio
import aiohttp
from aguasgaia import AguasGaia
async def main():
session = aiohttp.ClientSession()
aguas = AguasGaia(session, "<USERNAME>", "<PASSWORD>", subscription_id="<SUBSCRIPTION_ID>")
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
TBD
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
aguasgaia-0.0.18.tar.gz
(6.6 kB
view hashes)
Built Distribution
Close
Hashes for aguasgaia-0.0.18-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c236e2d4ef8ff47eedc0779b891bd5ea06bd9d78777e576c142dc555719103c |
|
MD5 | 641878dd9e458786c0317b9bea494907 |
|
BLAKE2b-256 | fd615d09b4cbc8cbf3a5ca9780ddec309a04c81aa2f9ff7efa8c33d81ea08555 |