aiotaipit


Nameaiotaipit JSON
Version 2.2.0 PyPI version JSON
download
home_page
SummaryAsynchronous Python API For Taipit Cloud Meters
upload_time2024-02-26 18:24:07
maintainer
docs_urlNone
authorLizardSystems
requires_python>=3.9.0
licenseMIT License
keywords taipit neva wi-fi electricity meter
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # aioTaipit

Asynchronous Python API for [Taipit cloud meters](https://cloud.meters.taipit.ru).

## Installation

Use pip to install the library:

```commandline
pip install aiotaipit
```

## Usage

```python
import asyncio
from pprint import pprint

import aiohttp

from aiotaipit import SimpleTaipitAuth, TaipitApi


async def main(username: str, password: str) -> None:
    """Create the aiohttp session and run the example."""
    async with aiohttp.ClientSession() as session:
        auth = SimpleTaipitAuth(username, password, session)
        api = TaipitApi(auth)

        meters = await api.async_get_meters()

        pprint(meters)


if __name__ == "__main__":
    _username = "<YOUR_USER_NAME>"
    _password = "<YOUR_PASSWORD>"
    asyncio.run(main(_username, _password))

```
The `SimpleTaipitAuth` client also accept custom client ID and secret (this can be found by sniffing the client).

This will return a price object that looks a little like this:

```python
[{'address': 'Санкт-Петербург, Ворошилова, 2',
  'category': 0,
  'ecometerdata': {'P_aver': 0.21986280758339,
                   'P_averSmall': 0.15261778589793,
                   'P_averSmall_': 109.88480584651,
                   'P_aver_': 158.30122146004,
                   'P_aver_TF1': False,
                   'P_aver_TF2': False,
                   'P_aver_TF31': False,
                   'P_aver_TF32': False,
                   'P_aver_TF33': False,
                   'P_norm': 0.0066666666666667,
                   'currentTS': 1671485359,
                   'ecoStatus': None,
                   'lastReading': {'energy_a': 1004.85,
                                   'energy_t1_a': 794.45,
                                   'energy_t2_a': 210.4,
                                   'energy_t3_a': 0,
                                   'ts_tz': 1671483628,
                                   'value': 0.02},
                   'meterCategory': 0,
                   'time': 1671485359,
                   'timezone': 3,
                   'trend': -48.41641561353,
                   'trendTF1': False,
                   'trendTF2': False},
  'id': 2147485997,
  'isLowDataFreq': False,
  'isOwner': False,
  'isVirtual': 0,
  'metername': 'НЕВА МТ 114 (Wi-Fi) (22001110)',
  'owner': {'peopleNumber': None, 'type': 0, 'typeCode': 'person'},
  'serialNumber': '22001110',
  'usericopath': '/uploads/user/photo/3edba895933a54540fbdb88614f24f480a9eeb68.png',
  'username': 'Компания Тайпит',
  'waterHot': False},
 {'address': 'Санкт-Петербург, Ворошилова, 2',
  'category': 0,
  'ecometerdata': {'P_aver': 0.25422232030182,
                   'P_averSmall': 0.2494024938596,
                   'P_averSmall_': 179.56979557891,
                   'P_aver_': 183.04007061731,
                   'P_aver_TF1': False,
                   'P_aver_TF2': False,
                   'P_aver_TF31': False,
                   'P_aver_TF32': False,
                   'P_aver_TF33': False,
                   'P_norm': 0,
                   'currentTS': 1671485359,
                   'ecoStatus': None,
                   'lastReading': {'energy_a': 11595.62,
                                   'energy_t1_a': 10420.94,
                                   'energy_t2_a': 1174.68,
                                   'energy_t3_a': 0,
                                   'ts_tz': 1671483641,
                                   'value': 0},
                   'meterCategory': 0,
                   'time': 1671485359,
                   'timezone': 3,
                   'trend': -3.4702750384005,
                   'trendTF1': False,
                   'trendTF2': False},
  'id': 2147485996,
  'isLowDataFreq': False,
  'isOwner': False,
  'isVirtual': 0,
  'metername': 'НЕВА МТ 114 (Wi-Fi) (22001114)',
  'owner': {'peopleNumber': None, 'type': 0, 'typeCode': 'person'},
  'serialNumber': '22001114',
  'usericopath': '/uploads/user/photo/3edba895933a54540fbdb88614f24f480a9eeb68.png',
  'username': 'Компания Тайпит',
  'waterHot': False}]
```

## Timeouts

aiotaipit does not specify any timeouts for any requests. You will need to specify them in your own code. We recommend the `timeout` from `asyncio` package:

```python
import asyncio

with asyncio.timeout(10):
    all_readings = await api.async_get_meters()
```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "aiotaipit",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9.0",
    "maintainer_email": "",
    "keywords": "taipit,neva,wi-fi,electricity meter",
    "author": "LizardSystems",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/cb/37/fef6abd5b81640a9f85c27591a4b19a1cf3aa886523ad8153c8205309eea/aiotaipit-2.2.0.tar.gz",
    "platform": "any",
    "description": "# aioTaipit\n\nAsynchronous Python API for [Taipit cloud meters](https://cloud.meters.taipit.ru).\n\n## Installation\n\nUse pip to install the library:\n\n```commandline\npip install aiotaipit\n```\n\n## Usage\n\n```python\nimport asyncio\nfrom pprint import pprint\n\nimport aiohttp\n\nfrom aiotaipit import SimpleTaipitAuth, TaipitApi\n\n\nasync def main(username: str, password: str) -> None:\n    \"\"\"Create the aiohttp session and run the example.\"\"\"\n    async with aiohttp.ClientSession() as session:\n        auth = SimpleTaipitAuth(username, password, session)\n        api = TaipitApi(auth)\n\n        meters = await api.async_get_meters()\n\n        pprint(meters)\n\n\nif __name__ == \"__main__\":\n    _username = \"<YOUR_USER_NAME>\"\n    _password = \"<YOUR_PASSWORD>\"\n    asyncio.run(main(_username, _password))\n\n```\nThe `SimpleTaipitAuth` client also accept custom client ID and secret (this can be found by sniffing the client).\n\nThis will return a price object that looks a little like this:\n\n```python\n[{'address': '\u0421\u0430\u043d\u043a\u0442-\u041f\u0435\u0442\u0435\u0440\u0431\u0443\u0440\u0433, \u0412\u043e\u0440\u043e\u0448\u0438\u043b\u043e\u0432\u0430, 2',\n  'category': 0,\n  'ecometerdata': {'P_aver': 0.21986280758339,\n                   'P_averSmall': 0.15261778589793,\n                   'P_averSmall_': 109.88480584651,\n                   'P_aver_': 158.30122146004,\n                   'P_aver_TF1': False,\n                   'P_aver_TF2': False,\n                   'P_aver_TF31': False,\n                   'P_aver_TF32': False,\n                   'P_aver_TF33': False,\n                   'P_norm': 0.0066666666666667,\n                   'currentTS': 1671485359,\n                   'ecoStatus': None,\n                   'lastReading': {'energy_a': 1004.85,\n                                   'energy_t1_a': 794.45,\n                                   'energy_t2_a': 210.4,\n                                   'energy_t3_a': 0,\n                                   'ts_tz': 1671483628,\n                                   'value': 0.02},\n                   'meterCategory': 0,\n                   'time': 1671485359,\n                   'timezone': 3,\n                   'trend': -48.41641561353,\n                   'trendTF1': False,\n                   'trendTF2': False},\n  'id': 2147485997,\n  'isLowDataFreq': False,\n  'isOwner': False,\n  'isVirtual': 0,\n  'metername': '\u041d\u0415\u0412\u0410 \u041c\u0422 114 (Wi-Fi) (22001110)',\n  'owner': {'peopleNumber': None, 'type': 0, 'typeCode': 'person'},\n  'serialNumber': '22001110',\n  'usericopath': '/uploads/user/photo/3edba895933a54540fbdb88614f24f480a9eeb68.png',\n  'username': '\u041a\u043e\u043c\u043f\u0430\u043d\u0438\u044f \u0422\u0430\u0439\u043f\u0438\u0442',\n  'waterHot': False},\n {'address': '\u0421\u0430\u043d\u043a\u0442-\u041f\u0435\u0442\u0435\u0440\u0431\u0443\u0440\u0433, \u0412\u043e\u0440\u043e\u0448\u0438\u043b\u043e\u0432\u0430, 2',\n  'category': 0,\n  'ecometerdata': {'P_aver': 0.25422232030182,\n                   'P_averSmall': 0.2494024938596,\n                   'P_averSmall_': 179.56979557891,\n                   'P_aver_': 183.04007061731,\n                   'P_aver_TF1': False,\n                   'P_aver_TF2': False,\n                   'P_aver_TF31': False,\n                   'P_aver_TF32': False,\n                   'P_aver_TF33': False,\n                   'P_norm': 0,\n                   'currentTS': 1671485359,\n                   'ecoStatus': None,\n                   'lastReading': {'energy_a': 11595.62,\n                                   'energy_t1_a': 10420.94,\n                                   'energy_t2_a': 1174.68,\n                                   'energy_t3_a': 0,\n                                   'ts_tz': 1671483641,\n                                   'value': 0},\n                   'meterCategory': 0,\n                   'time': 1671485359,\n                   'timezone': 3,\n                   'trend': -3.4702750384005,\n                   'trendTF1': False,\n                   'trendTF2': False},\n  'id': 2147485996,\n  'isLowDataFreq': False,\n  'isOwner': False,\n  'isVirtual': 0,\n  'metername': '\u041d\u0415\u0412\u0410 \u041c\u0422 114 (Wi-Fi) (22001114)',\n  'owner': {'peopleNumber': None, 'type': 0, 'typeCode': 'person'},\n  'serialNumber': '22001114',\n  'usericopath': '/uploads/user/photo/3edba895933a54540fbdb88614f24f480a9eeb68.png',\n  'username': '\u041a\u043e\u043c\u043f\u0430\u043d\u0438\u044f \u0422\u0430\u0439\u043f\u0438\u0442',\n  'waterHot': False}]\n```\n\n## Timeouts\n\naiotaipit does not specify any timeouts for any requests. You will need to specify them in your own code. We recommend the `timeout` from `asyncio` package:\n\n```python\nimport asyncio\n\nwith asyncio.timeout(10):\n    all_readings = await api.async_get_meters()\n```\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "Asynchronous Python API For Taipit Cloud Meters",
    "version": "2.2.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/lizardsystems/aiotaipit/issues",
        "Changelog": "https://github.com/lizardsystems/aiotaipit/blob/master/CHANGELOG.md",
        "Documentation": "https://github.com/lizardsystems/aiotaipit",
        "Home": "https://github.com/lizardsystems/aiotaipit",
        "Repository": "https://github.com/lizardsystems/aiotaipit"
    },
    "split_keywords": [
        "taipit",
        "neva",
        "wi-fi",
        "electricity meter"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bad5f98ddfb38f6eefd894af20c2caaa485122fd7fcd478de4b4b799625cbcc3",
                "md5": "92366e919c64d16ba42bfe35fa22d1e6",
                "sha256": "4da3ac06fd0da5ec0826562c5fea74189804a3ad03a704a25d33bf62e11eed91"
            },
            "downloads": -1,
            "filename": "aiotaipit-2.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "92366e919c64d16ba42bfe35fa22d1e6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9.0",
            "size": 12369,
            "upload_time": "2024-02-26T18:24:06",
            "upload_time_iso_8601": "2024-02-26T18:24:06.222248Z",
            "url": "https://files.pythonhosted.org/packages/ba/d5/f98ddfb38f6eefd894af20c2caaa485122fd7fcd478de4b4b799625cbcc3/aiotaipit-2.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cb37fef6abd5b81640a9f85c27591a4b19a1cf3aa886523ad8153c8205309eea",
                "md5": "eb95f821946f1969ea31e9b16bd839f5",
                "sha256": "12671a0acc9ebdd52b46ee88483553890b82bd5daddda96e37afb7f17dc2fd54"
            },
            "downloads": -1,
            "filename": "aiotaipit-2.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "eb95f821946f1969ea31e9b16bd839f5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9.0",
            "size": 31054,
            "upload_time": "2024-02-26T18:24:07",
            "upload_time_iso_8601": "2024-02-26T18:24:07.759474Z",
            "url": "https://files.pythonhosted.org/packages/cb/37/fef6abd5b81640a9f85c27591a4b19a1cf3aa886523ad8153c8205309eea/aiotaipit-2.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-26 18:24:07",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "lizardsystems",
    "github_project": "aiotaipit",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "aiotaipit"
}
        
Elapsed time: 0.19386s