Skip to main content

hydropeak-opendata

Async Python client for Hydro-Québec's public peak events (pointes hivernales) open data. No account, no login — just the open data feed.

Extracted from the HydroPeak Home Assistant integration.

Data sources

Data comes from Hydro-Québec's open data portal.

During Quebec winters (December 1 to March 31), Hydro-Québec triggers peak demand events (événements de pointe) when electricity demand is high due to cold weather and operational constraints. Customers enrolled in participating offers (e.g. Winter Credit, Flex, Hilo) are asked to reduce their consumption during these events — typically in the morning (AM) or evening (PM) — and receive bill credits in return. The dataset is updated as events are scheduled, and covers both residential and business customers.

  • Peak events — scheduled peak demand events with start/end times, time period (AM/PM), duration, applicable offer, and customer sector.
  • Available offers — the list of programs available each season, with descriptions and validity dates (rate limited; intended for occasional use such as setup flows).

Usage

import aiohttp
from hydropeak_opendata import OpenDataClient

async def main():
    async with aiohttp.ClientSession() as session:
        client = OpenDataClient(session)

        offers = await client.get_available_offers()
        # ('Credit hivernal Residentiel (CPC-D)', 'Flex Residentiel (TPC-DPC)', ...)

        events = await client.get_events(offers[0])
        for event in events:
            print(event.start, event.end, event.period, event.duration)

Notes:

  • Offer identifiers are the strings published in offresDisponibles, used verbatim. The library applies no transformation; get_events(offer) filters by exact match.
  • get_offer_labels() maps each canonical offer identifier to a display label for UIs. Labels currently equal the identifiers; once Hydro-Québec publishes display titles in its open data, a library update will source labels from there without any change to the method's contract — persist the keys, show the values.
  • The client sends conditional requests (If-None-Match) and serves its cached parse on 304 Not Modified, so frequent polling is cheap for both sides. Concurrent refreshes are serialized on a lock.
  • All datetimes from the feed are timezone-aware. PeakEventsFeed.last_execution is naive (the feed publishes it without an offset).
  • Errors raise typed exceptions: OpenDataConnectionError, OpenDataRateLimitError, OpenDataResponseError, OpenDataParseError — all subclasses of OpenDataError. Failures never silently return empty data.

Development

pip install -e .[dev]
ruff check .
mypy
pytest

License

MIT

Metadata

Release files for hydropeak-opendata 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hydropeak-opendata 0.2.0
File Size Uploaded Provenance Actions
hydropeak_opendata-0.2.0.tar.gz 10.2 kB With provenance Details for hydropeak_opendata-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for hydropeak-opendata 0.2.0
File Interpreter ABI Platform Actions
hydropeak_opendata-0.2.0-py3-none-any.whl Python 3 none any Details for hydropeak_opendata-0.2.0-py3-none-any.whl

Total release size: 19.0 kB

Release files / hydropeak_opendata-0.2.0.tar.gz

Download URL hydropeak_opendata-0.2.0.tar.gz
Size 10.2 kB
Tags Source
SHA-256 checksum
How to use checksums
01f9a4686ee0a24c629977c6aa90f5e4c9c4faff97a6997a5fab642fe8407256
BLAKE2b-256 checksum
How to use checksums
debe9e25ae84fe8feb769a11df109c91eb744d02462399bb8a8b20ae13e9e79c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 16, 2026.

Transparency log

Release files / hydropeak_opendata-0.2.0-py3-none-any.whl

Download URL hydropeak_opendata-0.2.0-py3-none-any.whl
Size 8.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
185cc94f6bfb8fd9feac687d7f7f2d0b7fbdc98d13bf53d4e29e45bc153d3c03
BLAKE2b-256 checksum
How to use checksums
f677e2747ee67c66fe5d6f7a16298476f803265ae8d5dc2623dc3e3396d05e8c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 16, 2026.

Transparency log

Security for hydropeak-opendata 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for hydropeak_opendata-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 16, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page