pymywatertoronto


Namepymywatertoronto JSON
Version 1.5.0 PyPI version JSON
download
home_page
SummaryLibrary built for Home Assistant to integrate with the City of Toronto MyWaterToronto service
upload_time2023-11-21 19:35:15
maintainer
docs_urlNone
author
requires_python>=3.11
licenseMIT License Copyright (c) 2022 David Pearce Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords water meter cityoftoronto
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 🌤️ Python Wrapper for MyWaterToronto REST API

![Latest PyPI version](https://img.shields.io/pypi/v/pymywatertoronto) ![Supported Python](https://img.shields.io/pypi/pyversions/pymywatertoronto)

This module communicates with the City of Toronto [MyWaterToronto](https://www.toronto.ca/services-payments/water-environment/how-to-use-less-water/mywatertoronto/) service.

The module is primarily written for the purpose of being used in Home Assistant for the Custom Integration called [`mywatertoronto`](https://github.com/davecpearce/hacs-mywatertoronto) .

This API will read the account information and obtain a list of address(es) and meter(s).

Consumption data incude

Unfortunately, the City of Toronto only appears to be pulling meter data every 1-2 days.

## Install

`pymywatertoronto` is available on PyPi:

```bash
pip install pymywatertoronto
```

## Consumption Buckets

This library will provide the following consumption buckets

- `Total usage`
- `Today usage`
- `Week-to-date usage`
- `Month-to-date usage`
- `Year-to-date usage`

## Usage

This library is primarily designed to be used in Home Assistant.

The main interface for the library is the `pymywatertoronto.MyWaterToronto`. This interface takes 6 options:

- `session`: (required) An existing _aiohttp.ClientSession_.
- `account_number`: (required) Enter your Account No. found on the utility bill.
- `client_number`: (required) Enter your Client No. found on the utility bill.
- `last_name`: (required) Enter your Last Name - must match the first last name on the utility bill.
- `postal_code`: (required) Enter your Postal Code - must match the postal code on the utility bill.
- `last_payment_method`: (required) use the enumerations from _const.LastPaymentMethod_.

Copy the _tests/template.env_ to _tests/.env_ file and update the account information with your your City of Toronto account information:

```python
ACCOUNT_NUMBER="000000000"
CLIENT_NUMBER="000000000-00"
LAST_NAME="lastname"
POSTAL_CODE="A1A 1A1"
LAST_PAYMENT_METHOD="4"
```

Use the enumerations from _const.LastPaymentMethod_.

Run the test file:
python tests/test_mywatertoronto.py [-h or --dump]

--dump paramater will create two files containing data that is leveraged in the Home Assistant integration:

- data_account_details.json
- data_consumption.json

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "pymywatertoronto",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": "",
    "keywords": "water,meter,cityoftoronto",
    "author": "",
    "author_email": "MyWaterToronto <davepearce@live.com>",
    "download_url": "https://files.pythonhosted.org/packages/9d/c0/509fb3885dd63dde7976e6b33723a3606cad86b7f61028207ce06ce54dc5/pymywatertoronto-1.5.0.tar.gz",
    "platform": null,
    "description": "# \ud83c\udf24\ufe0f Python Wrapper for MyWaterToronto REST API\n\n![Latest PyPI version](https://img.shields.io/pypi/v/pymywatertoronto) ![Supported Python](https://img.shields.io/pypi/pyversions/pymywatertoronto)\n\nThis module communicates with the City of Toronto [MyWaterToronto](https://www.toronto.ca/services-payments/water-environment/how-to-use-less-water/mywatertoronto/) service.\n\nThe module is primarily written for the purpose of being used in Home Assistant for the Custom Integration called [`mywatertoronto`](https://github.com/davecpearce/hacs-mywatertoronto) .\n\nThis API will read the account information and obtain a list of address(es) and meter(s).\n\nConsumption data incude\n\nUnfortunately, the City of Toronto only appears to be pulling meter data every 1-2 days.\n\n## Install\n\n`pymywatertoronto` is available on PyPi:\n\n```bash\npip install pymywatertoronto\n```\n\n## Consumption Buckets\n\nThis library will provide the following consumption buckets\n\n- `Total usage`\n- `Today usage`\n- `Week-to-date usage`\n- `Month-to-date usage`\n- `Year-to-date usage`\n\n## Usage\n\nThis library is primarily designed to be used in Home Assistant.\n\nThe main interface for the library is the `pymywatertoronto.MyWaterToronto`. This interface takes 6 options:\n\n- `session`: (required) An existing _aiohttp.ClientSession_.\n- `account_number`: (required) Enter your Account No. found on the utility bill.\n- `client_number`: (required) Enter your Client No. found on the utility bill.\n- `last_name`: (required) Enter your Last Name - must match the first last name on the utility bill.\n- `postal_code`: (required) Enter your Postal Code - must match the postal code on the utility bill.\n- `last_payment_method`: (required) use the enumerations from _const.LastPaymentMethod_.\n\nCopy the _tests/template.env_ to _tests/.env_ file and update the account information with your your City of Toronto account information:\n\n```python\nACCOUNT_NUMBER=\"000000000\"\nCLIENT_NUMBER=\"000000000-00\"\nLAST_NAME=\"lastname\"\nPOSTAL_CODE=\"A1A 1A1\"\nLAST_PAYMENT_METHOD=\"4\"\n```\n\nUse the enumerations from _const.LastPaymentMethod_.\n\nRun the test file:\npython tests/test_mywatertoronto.py [-h or --dump]\n\n--dump paramater will create two files containing data that is leveraged in the Home Assistant integration:\n\n- data_account_details.json\n- data_consumption.json\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2022 David Pearce  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "Library built for Home Assistant to integrate with the City of Toronto MyWaterToronto service",
    "version": "1.5.0",
    "project_urls": {
        "Homepage": "https://github.com/davecpearce/pymywatertoronto"
    },
    "split_keywords": [
        "water",
        "meter",
        "cityoftoronto"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fc3e36b70df6561dbbef15ab31c26044bfb961b3db9b8a871c7cca080810c50f",
                "md5": "f8a72276e48f7750d7bbf3ece0091fcf",
                "sha256": "6e4e68089d54703f82e2270ef43c079254f2ea25f07bd02d2047f0c239c37fa7"
            },
            "downloads": -1,
            "filename": "pymywatertoronto-1.5.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f8a72276e48f7750d7bbf3ece0091fcf",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 10608,
            "upload_time": "2023-11-21T19:35:13",
            "upload_time_iso_8601": "2023-11-21T19:35:13.142335Z",
            "url": "https://files.pythonhosted.org/packages/fc/3e/36b70df6561dbbef15ab31c26044bfb961b3db9b8a871c7cca080810c50f/pymywatertoronto-1.5.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9dc0509fb3885dd63dde7976e6b33723a3606cad86b7f61028207ce06ce54dc5",
                "md5": "30c64b9de1c79ab99ca8d550c1be57b1",
                "sha256": "f06427f141448c122e5920f5feca16f9bc109713ed026ed91bec1395fb50f0da"
            },
            "downloads": -1,
            "filename": "pymywatertoronto-1.5.0.tar.gz",
            "has_sig": false,
            "md5_digest": "30c64b9de1c79ab99ca8d550c1be57b1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 12154,
            "upload_time": "2023-11-21T19:35:15",
            "upload_time_iso_8601": "2023-11-21T19:35:15.816804Z",
            "url": "https://files.pythonhosted.org/packages/9d/c0/509fb3885dd63dde7976e6b33723a3606cad86b7f61028207ce06ce54dc5/pymywatertoronto-1.5.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-21 19:35:15",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "davecpearce",
    "github_project": "pymywatertoronto",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "pymywatertoronto"
}
        
Elapsed time: 0.14503s