aguasgaia


Nameaguasgaia JSON
Version 0.0.21 PyPI version JSON
download
home_pageNone
SummaryPython library to retrieve information from "Aguas de Gaia" portal
upload_time2024-08-24 11:33:51
maintainerNone
docs_urlNone
authorNone
requires_python>=3
licenseApache-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/73/88/458b39a29c32870e4962a541b5b0a6b21921e9edb1542a777139d0d0ca95/aguasgaia-0.0.21.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.21",
    "project_urls": null,
    "split_keywords": [
        "api",
        " aguasgaia"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "896751d44f78cdc3b65992be1c73cc47033fabe16b9249a872b9c4ae61d2753e",
                "md5": "2d1b783c586d96f8a243ee96ed956753",
                "sha256": "e3ca093edfd3a92cb5c26aef90c1b9711dfd89496022f25ad934b25d73bcbd35"
            },
            "downloads": -1,
            "filename": "aguasgaia-0.0.21-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2d1b783c586d96f8a243ee96ed956753",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3",
            "size": 8770,
            "upload_time": "2024-08-24T11:33:50",
            "upload_time_iso_8601": "2024-08-24T11:33:50.263140Z",
            "url": "https://files.pythonhosted.org/packages/89/67/51d44f78cdc3b65992be1c73cc47033fabe16b9249a872b9c4ae61d2753e/aguasgaia-0.0.21-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7388458b39a29c32870e4962a541b5b0a6b21921e9edb1542a777139d0d0ca95",
                "md5": "600086acaaf937391185197620fb2ca2",
                "sha256": "5aef82004b0b94eebf5ee0663848b8f60c6600d4ce0c150db4cbdbcfa35fb434"
            },
            "downloads": -1,
            "filename": "aguasgaia-0.0.21.tar.gz",
            "has_sig": false,
            "md5_digest": "600086acaaf937391185197620fb2ca2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3",
            "size": 6704,
            "upload_time": "2024-08-24T11:33:51",
            "upload_time_iso_8601": "2024-08-24T11:33:51.457419Z",
            "url": "https://files.pythonhosted.org/packages/73/88/458b39a29c32870e4962a541b5b0a6b21921e9edb1542a777139d0d0ca95/aguasgaia-0.0.21.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-24 11:33:51",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "aguasgaia"
}
        
Elapsed time: 0.34175s