Name | aguasgaia JSON |
Version |
0.0.19
JSON |
| download |
home_page | None |
Summary | Python library to retrieve information from "Aguas de Gaia" portal |
upload_time | 2024-05-27 11:31:04 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3 |
license | Apache-2.0 |
keywords |
api
aguasgaia
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# 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/
```
Raw data
{
"_id": null,
"home_page": null,
"name": "aguasgaia",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3",
"maintainer_email": null,
"keywords": "api, aguasgaia",
"author": null,
"author_email": "Jose Rolo <ze.p.rolo@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/9e/dd/f67f755fe0474c6811ea34d1017ee67db4d12922c845f78b8901f1d197a5/aguasgaia-0.0.19.tar.gz",
"platform": null,
"description": "# Aguas de Gaia API\n\n## Installation\n```bash\n$ pip install aguasgaia\n```\n## Usage\n```python\nimport asyncio\nimport aiohttp\nfrom aguasgaia import AguasGaia\n\n\nasync def main():\n session = aiohttp.ClientSession()\n\n aguas = AguasGaia(session, \"<USERNAME>\", \"<PASSWORD>\")\n print(\"LOGIN: \", await aguas.login())\n\n print(\"SUBSCRIPTIONS:\\n{0}\".format(await aguas.get_subscriptions()))\n\n inv = await aguas.get_last_invoice()\n print(\"INVOICE: {0}\\n{1}\".format(inv.invoice_value, inv.invoice_attributes))\n\n consumption = await aguas.get_last_consumption()\n print(\"CONSUMPTION: {0}\\n{1}\".format(consumption.consumption_value, consumption.consumption_attributes))\n\n await session.close()\n\nif __name__ == \"__main__\":\n asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())\n asyncio.run(main())\n```\n\n## Tests\nMake sure pytest asyncio is installed\n```bash\n$ pip install pytest-asyncio\n```\nExecute the tests\n```bash\n$ pytest tests/\n```\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "Python library to retrieve information from \"Aguas de Gaia\" portal",
"version": "0.0.19",
"project_urls": null,
"split_keywords": [
"api",
" aguasgaia"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "7fc5b6b84ac661324661b49e655eef7aef92551d3063d9e407a5267c2a8e240e",
"md5": "6f142d85f4a7bf0533dd5bf745073424",
"sha256": "e95d858c3f1446326ddb4ccae9dedf42e83526389975d04c75979672ed033ee6"
},
"downloads": -1,
"filename": "aguasgaia-0.0.19-py3-none-any.whl",
"has_sig": false,
"md5_digest": "6f142d85f4a7bf0533dd5bf745073424",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3",
"size": 8765,
"upload_time": "2024-05-27T11:31:02",
"upload_time_iso_8601": "2024-05-27T11:31:02.831857Z",
"url": "https://files.pythonhosted.org/packages/7f/c5/b6b84ac661324661b49e655eef7aef92551d3063d9e407a5267c2a8e240e/aguasgaia-0.0.19-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "9eddf67f755fe0474c6811ea34d1017ee67db4d12922c845f78b8901f1d197a5",
"md5": "595c7dd7a4d023a2896726a6b1cd1ada",
"sha256": "99e3a55509601c4d08d19f3d3ab0cedf8d30a69b5fa2ff08d683d94cebc55ad6"
},
"downloads": -1,
"filename": "aguasgaia-0.0.19.tar.gz",
"has_sig": false,
"md5_digest": "595c7dd7a4d023a2896726a6b1cd1ada",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3",
"size": 6663,
"upload_time": "2024-05-27T11:31:04",
"upload_time_iso_8601": "2024-05-27T11:31:04.456925Z",
"url": "https://files.pythonhosted.org/packages/9e/dd/f67f755fe0474c6811ea34d1017ee67db4d12922c845f78b8901f1d197a5/aguasgaia-0.0.19.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-27 11:31:04",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "aguasgaia"
}