pydiscovergy


Namepydiscovergy JSON
Version 3.0.0 PyPI version JSON
download
home_pagehttps://github.com/jpbede/pydiscovergy
SummaryAsync Python 3 library for interacting with Discovergy smart meters API
upload_time2024-02-24 18:38:37
maintainer
docs_urlNone
authorJan-Philipp Benecke
requires_python>=3.11,<4.0
licenseMIT
keywords discovergy smart meter smart home
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pydiscovergy

[![GitHub Release][releases-shield]][releases]
[![Python Versions][python-versions-shield]][pypi]
![Project Stage][project-stage-shield]
![Project Maintenance][maintenance-shield]
[![License][license-shield]](LICENSE.md)

[![Build Status][build-shield]][build]
[![Code Coverage][codecov-shield]][codecov]

Asynchronous Python client for Discovergy smart meter using their API.

## About

This package allows you to fetch data from api.discovergy.com.

## Installation

```bash
pip install pydiscovergy
```

## Usage

```python
import asyncio

from pydiscovergy import Discovergy

async def main():
    discovergy = Discovergy(email="demo@example.com", password="demo")
    meters = await discovergy.meters()

    for meter in meters:
        if meter.meter_id == "abc123":
            reading = await discovergy.meter_last_reading(meter.meter_id)
            print(f"Last reading: {reading.values['energy']} kWh")

if __name__ == "__main__":
    asyncio.run(main())
```

## Changelog & Releases

This repository keeps a change log using [GitHub's releases][releases]
functionality. The format of the log is based on
[Keep a Changelog][keepchangelog].

Releases are based on [Semantic Versioning][semver], and use the format
of `MAJOR.MINOR.PATCH`. In a nutshell, the version will be incremented
based on the following:

- `MAJOR`: Incompatible or major changes.
- `MINOR`: Backwards-compatible new features and enhancements.
- `PATCH`: Backwards-compatible bugfixes and package updates.

## Contributing

This is an active open-source project. I am always open to people who want to
use the code or contribute to it.

Thank you for being involved! :heart_eyes:

## Setting up development environment

This Python project is fully managed using the [Poetry][poetry] dependency manager. But also relies on the use of NodeJS for certain checks during development.

You need at least:

- Python 3.11+
- [Poetry][poetry-install]
- NodeJS 20+ (including NPM)

To install all packages, including all development requirements:

```bash
npm install
poetry install
```

As this repository uses the [pre-commit][pre-commit] framework, all changes
are linted and tested with each commit. You can run all checks and tests
manually, using the following command:

```bash
poetry run pre-commit run --all-files
```

To run just the Python tests:

```bash
poetry run pytest
```

## Authors & contributors

The content is by [Jan-Philipp Benecke][jpbede].

For a full list of all authors and contributors,
check [the contributor's page][contributors].

## License

MIT License

Copyright (c) 2023 Jan-Philipp Benecke

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.

[build-shield]: https://github.com/jpbede/pydiscovergy/actions/workflows/release.yml/badge.svg
[build]: https://github.com/jpbede/pydiscovergy/actions
[codecov-shield]: https://codecov.io/gh/jpbede/pydiscovergy/branch/main/graph/badge.svg
[codecov]: https://codecov.io/gh/jpbede/pydiscovergy
[commits-shield]: https://img.shields.io/github/commit-activity/y/jpbede/pydiscovergy.svg
[commits]: https://github.com/jpbede/pydiscovergy/commits/main
[contributors]: https://github.com/jpbede/pydiscovergy/graphs/contributors
[jpbede]: https://github.com/jpbede
[keepchangelog]: http://keepachangelog.com/en/1.0.0/
[license-shield]: https://img.shields.io/github/license/jpbede/pydiscovergy.svg
[maintenance-shield]: https://img.shields.io/maintenance/yes/2024.svg
[poetry-install]: https://python-poetry.org/docs/#installation
[poetry]: https://python-poetry.org
[pre-commit]: https://pre-commit.com/
[project-stage-shield]: https://img.shields.io/badge/project%20stage-stable-green.svg
[python-versions-shield]: https://img.shields.io/pypi/pyversions/pydiscovergy
[releases-shield]: https://img.shields.io/github/release/jpbede/pydiscovergy.svg
[releases]: https://github.com/jpbede/pydiscovergy/releases
[semver]: http://semver.org/spec/v2.0.0.html
[pypi]: https://pypi.org/project/pydiscovergy/


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/jpbede/pydiscovergy",
    "name": "pydiscovergy",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.11,<4.0",
    "maintainer_email": "",
    "keywords": "discovergy,smart meter,smart home",
    "author": "Jan-Philipp Benecke",
    "author_email": "jan-philipp@bnck.me",
    "download_url": "https://files.pythonhosted.org/packages/21/8b/5dac0afab9bbf2efb021ec36fc157a03bab69cc8d6ba576c54204d3cf2de/pydiscovergy-3.0.0.tar.gz",
    "platform": null,
    "description": "# pydiscovergy\n\n[![GitHub Release][releases-shield]][releases]\n[![Python Versions][python-versions-shield]][pypi]\n![Project Stage][project-stage-shield]\n![Project Maintenance][maintenance-shield]\n[![License][license-shield]](LICENSE.md)\n\n[![Build Status][build-shield]][build]\n[![Code Coverage][codecov-shield]][codecov]\n\nAsynchronous Python client for Discovergy smart meter using their API.\n\n## About\n\nThis package allows you to fetch data from api.discovergy.com.\n\n## Installation\n\n```bash\npip install pydiscovergy\n```\n\n## Usage\n\n```python\nimport asyncio\n\nfrom pydiscovergy import Discovergy\n\nasync def main():\n    discovergy = Discovergy(email=\"demo@example.com\", password=\"demo\")\n    meters = await discovergy.meters()\n\n    for meter in meters:\n        if meter.meter_id == \"abc123\":\n            reading = await discovergy.meter_last_reading(meter.meter_id)\n            print(f\"Last reading: {reading.values['energy']} kWh\")\n\nif __name__ == \"__main__\":\n    asyncio.run(main())\n```\n\n## Changelog & Releases\n\nThis repository keeps a change log using [GitHub's releases][releases]\nfunctionality. The format of the log is based on\n[Keep a Changelog][keepchangelog].\n\nReleases are based on [Semantic Versioning][semver], and use the format\nof `MAJOR.MINOR.PATCH`. In a nutshell, the version will be incremented\nbased on the following:\n\n- `MAJOR`: Incompatible or major changes.\n- `MINOR`: Backwards-compatible new features and enhancements.\n- `PATCH`: Backwards-compatible bugfixes and package updates.\n\n## Contributing\n\nThis is an active open-source project. I am always open to people who want to\nuse the code or contribute to it.\n\nThank you for being involved! :heart_eyes:\n\n## Setting up development environment\n\nThis Python project is fully managed using the [Poetry][poetry] dependency manager. But also relies on the use of NodeJS for certain checks during development.\n\nYou need at least:\n\n- Python 3.11+\n- [Poetry][poetry-install]\n- NodeJS 20+ (including NPM)\n\nTo install all packages, including all development requirements:\n\n```bash\nnpm install\npoetry install\n```\n\nAs this repository uses the [pre-commit][pre-commit] framework, all changes\nare linted and tested with each commit. You can run all checks and tests\nmanually, using the following command:\n\n```bash\npoetry run pre-commit run --all-files\n```\n\nTo run just the Python tests:\n\n```bash\npoetry run pytest\n```\n\n## Authors & contributors\n\nThe content is by [Jan-Philipp Benecke][jpbede].\n\nFor a full list of all authors and contributors,\ncheck [the contributor's page][contributors].\n\n## License\n\nMIT License\n\nCopyright (c) 2023 Jan-Philipp Benecke\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n[build-shield]: https://github.com/jpbede/pydiscovergy/actions/workflows/release.yml/badge.svg\n[build]: https://github.com/jpbede/pydiscovergy/actions\n[codecov-shield]: https://codecov.io/gh/jpbede/pydiscovergy/branch/main/graph/badge.svg\n[codecov]: https://codecov.io/gh/jpbede/pydiscovergy\n[commits-shield]: https://img.shields.io/github/commit-activity/y/jpbede/pydiscovergy.svg\n[commits]: https://github.com/jpbede/pydiscovergy/commits/main\n[contributors]: https://github.com/jpbede/pydiscovergy/graphs/contributors\n[jpbede]: https://github.com/jpbede\n[keepchangelog]: http://keepachangelog.com/en/1.0.0/\n[license-shield]: https://img.shields.io/github/license/jpbede/pydiscovergy.svg\n[maintenance-shield]: https://img.shields.io/maintenance/yes/2024.svg\n[poetry-install]: https://python-poetry.org/docs/#installation\n[poetry]: https://python-poetry.org\n[pre-commit]: https://pre-commit.com/\n[project-stage-shield]: https://img.shields.io/badge/project%20stage-stable-green.svg\n[python-versions-shield]: https://img.shields.io/pypi/pyversions/pydiscovergy\n[releases-shield]: https://img.shields.io/github/release/jpbede/pydiscovergy.svg\n[releases]: https://github.com/jpbede/pydiscovergy/releases\n[semver]: http://semver.org/spec/v2.0.0.html\n[pypi]: https://pypi.org/project/pydiscovergy/\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Async Python 3 library for interacting with Discovergy smart meters API",
    "version": "3.0.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/jpbede/pydiscovergy/issues",
        "Changelog": "https://github.com/jpbede/pydiscovergy/releases",
        "Homepage": "https://github.com/jpbede/pydiscovergy",
        "Repository": "https://github.com/jpbede/pydiscovergy"
    },
    "split_keywords": [
        "discovergy",
        "smart meter",
        "smart home"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5654774d5473954f4ecbfe39f3741fa60299cf211a70b01a8f083fb9f41ce5af",
                "md5": "9ffb73580627c2b60f6b663c0dae4a37",
                "sha256": "08ec98d3162a71da56dbc533e53f16423c67d97e07c0a8d15e5187a5a766ecb1"
            },
            "downloads": -1,
            "filename": "pydiscovergy-3.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9ffb73580627c2b60f6b663c0dae4a37",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11,<4.0",
            "size": 11863,
            "upload_time": "2024-02-24T18:38:35",
            "upload_time_iso_8601": "2024-02-24T18:38:35.975987Z",
            "url": "https://files.pythonhosted.org/packages/56/54/774d5473954f4ecbfe39f3741fa60299cf211a70b01a8f083fb9f41ce5af/pydiscovergy-3.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "218b5dac0afab9bbf2efb021ec36fc157a03bab69cc8d6ba576c54204d3cf2de",
                "md5": "642e4af944342e05f8e68bf349022d54",
                "sha256": "d4cc305791db6a6be6f02afc238215acc7d092c107068657825ca5c1b23e9208"
            },
            "downloads": -1,
            "filename": "pydiscovergy-3.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "642e4af944342e05f8e68bf349022d54",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11,<4.0",
            "size": 11508,
            "upload_time": "2024-02-24T18:38:37",
            "upload_time_iso_8601": "2024-02-24T18:38:37.405358Z",
            "url": "https://files.pythonhosted.org/packages/21/8b/5dac0afab9bbf2efb021ec36fc157a03bab69cc8d6ba576c54204d3cf2de/pydiscovergy-3.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-24 18:38:37",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "jpbede",
    "github_project": "pydiscovergy",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pydiscovergy"
}
        
Elapsed time: 0.22973s