Metadata-Version: 2.5
Name: pyhydropannes
Version: 0.1.1
Summary: Async client for Hydro-QuÃ©bec's Info-pannes outage service
Project-URL: Homepage, https://github.com/johnjohn-11/pyhydropannes
Project-URL: Issues, https://github.com/johnjohn-11/pyhydropannes/issues
Author: johnjohn-11
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: AsyncIO
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Home Automation
Classifier: Typing :: Typed
Requires-Python: >=3.13
Requires-Dist: aiohttp>=3.9
Requires-Dist: tzdata; sys_platform == 'win32'
Provides-Extra: dev
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.6; extra == 'dev'
Description-Content-Type: text/markdown

# pyhydropannes

Async Python client for Hydro-Québec's public Info-pannes outage service, used by the Hydro-Pannes Home Assistant integration.

It fetches the outage state of a consumption location, looks up the locations at an address and reads a payload the way the Info-pannes site does.

## Usage

```python
import asyncio

import aiohttp

from pyhydropannes import HydroPannesClient, LocationState


async def main() -> None:
    async with aiohttp.ClientSession() as session:
        client = HydroPannesClient(session)
        locations = await client.async_search_locations("A1A 1A1", "123")
        payload = await client.async_get_payload(locations[0].id)
        state = LocationState.from_payload(payload)
        print(state.active_outage, state.planned)


asyncio.run(main())
```

5xx answers, timeouts and connection errors are retried (`max_retries`, `retry_delay`). Every error raised derives from `HydroPannesError`.

## Development

```bash
python -m venv .venv
.venv/bin/pip install -e ".[dev]"
.venv/bin/ruff check src tests
.venv/bin/mypy
.venv/bin/pytest --cov=pyhydropannes
```

## Disclaimer

This project is not affiliated with Hydro-Québec. The endpoints it uses are the ones the public Info-pannes site calls and are not documented by Hydro-Québec.
