combined-energy-api


Namecombined-energy-api JSON
Version 0.8 PyPI version JSON
download
home_pagehttps://github.com/timsavage/combined-energy-api
SummaryPython interface to the Combined Energy API
upload_time2024-12-05 11:39:53
maintainerTim Savage
docs_urlNone
authorTim Savage
requires_python<4.0,>=3.11
licenseBSD-3-Clause
keywords energy monitoring combined.energy api client async
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Python: Asynchronous client for Combined Energy API

Provides an async Python 3.11+ interface for the http://combined.energy/ monitoring platform API.

<p align="center">

[![Testing](https://github.com/timsavage/combined-energy-api/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/timsavage/combined-energy-api/actions/workflows/tests.yml)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=timsavage_combined-energy-api&metric=coverage)](https://sonarcloud.io/summary/new_code?id=timsavage_combined-energy-api)
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=timsavage_combined-energy-api&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=timsavage_combined-energy-api)
[![PyPI](https://img.shields.io/pypi/v/combined-energy-api?color=green)](https://pypi.org/project/combined-energy-api)
![PyPI - License](https://img.shields.io/pypi/l/combined-energy-api)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

</p>

> Note this API client is reverse engineered from observing requests being made
> in the web-application. Please report any failures to read data, this is likely
> to occur for readings as I am only able to create entries for devices that I
> have.

## Installation

Install from PyPI

```shell
python3 -m pip install combined-energy-api
```

## Usage

```python
import asyncio

from combined_energy import CombinedEnergy
from combined_energy.helpers import ReadingsIterator

async def main():
    """
    Example using Combined Energy API client.
    """

    async with CombinedEnergy(
        mobile_or_email="user@example.com",
        password="YOUR_COMBINED_ENERGY_PASSWORD",
        installation_id=9999,
    ) as combined_energy:

        status = await combined_energy.communication_status()
        print(status)

        # To generate a stream of readings use the iterator, this example fetches
        # data in 5 minute increments
        async for readings in ReadingsIterator(combined_energy, increment=300):
            print(readings)
            await asyncio.sleep(300)

asyncio.run(main())
```


### Development Environment

You will need:

- Python 3.11+
- poetry
- pre-commit

Ensure pre-commit is installed into your git repository with `pre-commit install`.


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/timsavage/combined-energy-api",
    "name": "combined-energy-api",
    "maintainer": "Tim Savage",
    "docs_url": null,
    "requires_python": "<4.0,>=3.11",
    "maintainer_email": "tim@savage.company",
    "keywords": "energy, monitoring, combined.energy, api, client, async",
    "author": "Tim Savage",
    "author_email": "tim@savage.company",
    "download_url": "https://files.pythonhosted.org/packages/32/04/e59f22f9cb73277aa4aef26ba508200badc6579f09d2fb689f23f684239b/combined_energy_api-0.8.tar.gz",
    "platform": null,
    "description": "# Python: Asynchronous client for Combined Energy API\n\nProvides an async Python 3.11+ interface for the http://combined.energy/ monitoring platform API.\n\n<p align=\"center\">\n\n[![Testing](https://github.com/timsavage/combined-energy-api/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/timsavage/combined-energy-api/actions/workflows/tests.yml)\n[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=timsavage_combined-energy-api&metric=coverage)](https://sonarcloud.io/summary/new_code?id=timsavage_combined-energy-api)\n[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=timsavage_combined-energy-api&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=timsavage_combined-energy-api)\n[![PyPI](https://img.shields.io/pypi/v/combined-energy-api?color=green)](https://pypi.org/project/combined-energy-api)\n![PyPI - License](https://img.shields.io/pypi/l/combined-energy-api)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\n</p>\n\n> Note this API client is reverse engineered from observing requests being made\n> in the web-application. Please report any failures to read data, this is likely\n> to occur for readings as I am only able to create entries for devices that I\n> have.\n\n## Installation\n\nInstall from PyPI\n\n```shell\npython3 -m pip install combined-energy-api\n```\n\n## Usage\n\n```python\nimport asyncio\n\nfrom combined_energy import CombinedEnergy\nfrom combined_energy.helpers import ReadingsIterator\n\nasync def main():\n    \"\"\"\n    Example using Combined Energy API client.\n    \"\"\"\n\n    async with CombinedEnergy(\n        mobile_or_email=\"user@example.com\",\n        password=\"YOUR_COMBINED_ENERGY_PASSWORD\",\n        installation_id=9999,\n    ) as combined_energy:\n\n        status = await combined_energy.communication_status()\n        print(status)\n\n        # To generate a stream of readings use the iterator, this example fetches\n        # data in 5 minute increments\n        async for readings in ReadingsIterator(combined_energy, increment=300):\n            print(readings)\n            await asyncio.sleep(300)\n\nasyncio.run(main())\n```\n\n\n### Development Environment\n\nYou will need:\n\n- Python 3.11+\n- poetry\n- pre-commit\n\nEnsure pre-commit is installed into your git repository with `pre-commit install`.\n\n",
    "bugtrack_url": null,
    "license": "BSD-3-Clause",
    "summary": "Python interface to the Combined Energy API",
    "version": "0.8",
    "project_urls": {
        "Documentation": "https://github.com/timsavage/combined-energy-api",
        "Homepage": "https://github.com/timsavage/combined-energy-api",
        "Repository": "https://github.com/timsavage/combined-energy-api"
    },
    "split_keywords": [
        "energy",
        " monitoring",
        " combined.energy",
        " api",
        " client",
        " async"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "285a46b733824ac22b2a8925050e5304523786e7f6a32aba1aab030a834f9d31",
                "md5": "d410dfa0a31ea656728ddbc172c057cf",
                "sha256": "8c24280ab562301ce362f3708c9d6ee3862dffc192a6c995df23535ab9bb0906"
            },
            "downloads": -1,
            "filename": "combined_energy_api-0.8-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d410dfa0a31ea656728ddbc172c057cf",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.11",
            "size": 11959,
            "upload_time": "2024-12-05T11:39:52",
            "upload_time_iso_8601": "2024-12-05T11:39:52.715435Z",
            "url": "https://files.pythonhosted.org/packages/28/5a/46b733824ac22b2a8925050e5304523786e7f6a32aba1aab030a834f9d31/combined_energy_api-0.8-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3204e59f22f9cb73277aa4aef26ba508200badc6579f09d2fb689f23f684239b",
                "md5": "54c1880c1a414ec9a3329794abb3c435",
                "sha256": "ee179740a034fd3b4346b0baab56f94e9b130f5f3f75d32e989c14e636139816"
            },
            "downloads": -1,
            "filename": "combined_energy_api-0.8.tar.gz",
            "has_sig": false,
            "md5_digest": "54c1880c1a414ec9a3329794abb3c435",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.11",
            "size": 18693,
            "upload_time": "2024-12-05T11:39:53",
            "upload_time_iso_8601": "2024-12-05T11:39:53.591446Z",
            "url": "https://files.pythonhosted.org/packages/32/04/e59f22f9cb73277aa4aef26ba508200badc6579f09d2fb689f23f684239b/combined_energy_api-0.8.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-05 11:39:53",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "timsavage",
    "github_project": "combined-energy-api",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "combined-energy-api"
}
        
Elapsed time: 0.41240s