combined-energy-api


Namecombined-energy-api JSON
Version 0.7 PyPI version JSON
download
home_pagehttps://github.com/timsavage/combined-energy-api
SummaryPython interface to the Combined Energy API
upload_time2023-11-27 09:40:30
maintainerTim Savage
docs_urlNone
authorTim Savage
requires_python>=3.10,<4.0
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.8+ 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.8+
- 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": ">=3.10,<4.0",
    "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/71/2d/dadb9592d6e9e8b6a8e16db51a6c1e8e3d04f7b092525f7f000e3929d1fd/combined_energy_api-0.7.tar.gz",
    "platform": null,
    "description": "# Python: Asynchronous client for Combined Energy API\n\nProvides an async Python 3.8+ 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.8+\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.7",
    "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": "afc0d47b7a777243fe545f7b1b1db4e058366dadb9bc3d00ea1608c5f4bda743",
                "md5": "75ab6d3624f9a131be193a9e23a48d6b",
                "sha256": "db350473734185638b10235a4af29fb6aee5f374943ef77f1f1a636c95387dd8"
            },
            "downloads": -1,
            "filename": "combined_energy_api-0.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "75ab6d3624f9a131be193a9e23a48d6b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10,<4.0",
            "size": 12002,
            "upload_time": "2023-11-27T09:40:28",
            "upload_time_iso_8601": "2023-11-27T09:40:28.934967Z",
            "url": "https://files.pythonhosted.org/packages/af/c0/d47b7a777243fe545f7b1b1db4e058366dadb9bc3d00ea1608c5f4bda743/combined_energy_api-0.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "712ddadb9592d6e9e8b6a8e16db51a6c1e8e3d04f7b092525f7f000e3929d1fd",
                "md5": "bcd31ce2448e70a844f57c8ff32bb724",
                "sha256": "68500d42bb0e3cc21093339d65374919822fc6bc3b71eac69182d5a9f556d443"
            },
            "downloads": -1,
            "filename": "combined_energy_api-0.7.tar.gz",
            "has_sig": false,
            "md5_digest": "bcd31ce2448e70a844f57c8ff32bb724",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10,<4.0",
            "size": 18723,
            "upload_time": "2023-11-27T09:40:30",
            "upload_time_iso_8601": "2023-11-27T09:40:30.024871Z",
            "url": "https://files.pythonhosted.org/packages/71/2d/dadb9592d6e9e8b6a8e16db51a6c1e8e3d04f7b092525f7f000e3929d1fd/combined_energy_api-0.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-27 09:40:30",
    "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.14329s