Hydro-Quebec-API-Wrapper 4.2.2__tar.gz → 4.2.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/.pre-commit-config.yaml +1 -1
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/Hydro_Quebec_API_Wrapper.egg-info/PKG-INFO +1 -1
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/PKG-INFO +1 -1
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/contract/contract_dpc.py +21 -23
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/hydro_api/client.py +24 -20
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/test_requirements.txt +1 -1
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/.coveragerc +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/.devcontainer/Dockerfile +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/.devcontainer/devcontainer.json +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/.flake8 +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/.gitignore +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/.gitlab-ci.yml +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/.pylintrc +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/Hydro_Quebec_API_Wrapper.egg-info/SOURCES.txt +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/Hydro_Quebec_API_Wrapper.egg-info/dependency_links.txt +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/Hydro_Quebec_API_Wrapper.egg-info/entry_points.txt +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/Hydro_Quebec_API_Wrapper.egg-info/requires.txt +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/Hydro_Quebec_API_Wrapper.egg-info/top_level.txt +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/LICENSE +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/MANIFEST.in +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/README.md +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/config.default.yaml +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/conflict_test_requirements.txt +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/docs/Makefile +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/docs/make.bat +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/docs/source/_static/custom.css +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/docs/source/_static/hydroqc-logo-128.png +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/docs/source/_static/hydroqc-logo.svg +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/docs/source/conf.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/docs/source/external/description-des-codes-interruption.pdf +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/docs/source/index.rst +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/docs/source/reference/hydroqc.contract.rst +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/docs/source/reference/hydroqc.hydro_api.rst +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/docs/source/reference/hydroqc.peak.cpc.rst +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/docs/source/reference/hydroqc.peak.dpc.rst +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/docs/source/reference/hydroqc.peak.rst +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/docs/source/reference/hydroqc.rst +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/docs/source/reference/hydroqc.types.rst +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/docs/source/reference/modules.rst +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/docs/source/todo.rst +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/examples/hydro.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/__init__.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/account.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/consts.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/contract/__init__.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/contract/common.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/contract/contract_d.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/contract/contract_d_cpc.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/contract/contract_dt.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/contract/contract_m.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/contract/contract_m_gdp.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/contract/contract_residential.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/contract/outage.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/customer.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/diagnostic.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/error.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/hydro_api/__init__.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/hydro_api/cache.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/hydro_api/consts.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/logger.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/peak/__init__.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/peak/basepeak.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/peak/basepeakhandler.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/peak/consts.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/peak/cpc/__init__.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/peak/cpc/consts.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/peak/cpc/handler.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/peak/cpc/peak.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/peak/dpc/__init__.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/peak/dpc/consts.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/peak/dpc/handler.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/peak/dpc/peak.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/public_client.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/py.typed +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/timerange.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/types/__init__.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/types/account.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/types/common.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/types/consump.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/types/contract.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/types/cpc.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/types/dpc.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/types/dt.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/types/outage.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/utils.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/webuser.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/logo/hydroqc-logo-128.png +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/logo/hydroqc-logo.svg +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/pyproject.toml +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/renovate.json5 +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/setup.cfg +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/tests/__init__.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/tests/conftest.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/tests/subtest_common.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/tests/subtest_contract_d.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/tests/subtest_contract_d_cpc.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/tests/subtest_contract_dpc.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/tests/subtest_contract_dt.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/tests/subtest_contract_m.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/tests/subtest_contract_m_gdp.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/tests/test_basic.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/tests/test_timerange.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/tests/tools.py +0 -0
- {hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/tox.ini +0 -0
{hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/contract/contract_dpc.py
RENAMED
|
@@ -21,7 +21,10 @@ class WinterState(str, Enum):
|
|
|
21
21
|
def check_dpc_data_present(
|
|
22
22
|
method: Callable[..., None | str | bool | float | int | date | WinterState],
|
|
23
23
|
) -> Callable[..., None | str | bool | float | int | date | WinterState]:
|
|
24
|
-
"""Check if contractDPC's data are present.
|
|
24
|
+
"""Check if contractDPC's data are present.
|
|
25
|
+
|
|
26
|
+
Returns None if data is not available or incomplete.
|
|
27
|
+
"""
|
|
25
28
|
|
|
26
29
|
def wrapper(
|
|
27
30
|
contract: "ContractDPC",
|
|
@@ -110,19 +113,6 @@ class ContractDPC(ContractResidential):
|
|
|
110
113
|
)
|
|
111
114
|
return self._dpc_data
|
|
112
115
|
|
|
113
|
-
def _get_dpc_field(self, field_name: str) -> str | float | int:
|
|
114
|
-
"""Get DPC field from periodesHiver data.
|
|
115
|
-
|
|
116
|
-
Raises:
|
|
117
|
-
KeyError: If the required field is not present in the API response.
|
|
118
|
-
"""
|
|
119
|
-
winter_period = self._dpc_data["periodesHiver"][0]
|
|
120
|
-
if field_name not in winter_period:
|
|
121
|
-
raise KeyError(
|
|
122
|
-
f"Required field '{field_name}' not found in DPC periodesHiver data"
|
|
123
|
-
)
|
|
124
|
-
return winter_period[field_name] # type: ignore
|
|
125
|
-
|
|
126
116
|
@property
|
|
127
117
|
@check_period_data_present
|
|
128
118
|
def cp_lower_price_consumption(self) -> float:
|
|
@@ -148,7 +138,7 @@ class ContractDPC(ContractResidential):
|
|
|
148
138
|
@check_dpc_data_present
|
|
149
139
|
def last_update_date(self) -> date:
|
|
150
140
|
"""DPC data last update."""
|
|
151
|
-
date_str = str(self.
|
|
141
|
+
date_str = str(self._dpc_data["periodesHiver"][0]["dateMaj"])
|
|
152
142
|
# Handle ISO format with timezone
|
|
153
143
|
if "T" in date_str:
|
|
154
144
|
return date.fromisoformat(date_str.split("T", maxsplit=1)[0])
|
|
@@ -157,14 +147,17 @@ class ContractDPC(ContractResidential):
|
|
|
157
147
|
@property
|
|
158
148
|
@check_dpc_data_present
|
|
159
149
|
def critical_called_hours(self) -> int:
|
|
160
|
-
"""Get number of critical hours.
|
|
161
|
-
|
|
150
|
+
"""Get number of critical hours.
|
|
151
|
+
|
|
152
|
+
Returns 0 for current ongoing winter period where hours haven't been called yet.
|
|
153
|
+
"""
|
|
154
|
+
return int(self._dpc_data["periodesHiver"][0].get("hrsCritiquesAppelees", 0))
|
|
162
155
|
|
|
163
156
|
@property
|
|
164
157
|
@check_dpc_data_present
|
|
165
158
|
def max_critical_called_hours(self) -> int:
|
|
166
159
|
"""Get max number of critical hours."""
|
|
167
|
-
return int(self.
|
|
160
|
+
return int(self._dpc_data["periodesHiver"][0]["hrsCritiquesAppeleesMax"])
|
|
168
161
|
|
|
169
162
|
@property
|
|
170
163
|
@check_dpc_data_present
|
|
@@ -173,10 +166,12 @@ class ContractDPC(ContractResidential):
|
|
|
173
166
|
|
|
174
167
|
Returns None if comparison data is not yet available (e.g., first year on Flex D).
|
|
175
168
|
"""
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
169
|
+
if (
|
|
170
|
+
self._dpc_data["periodesHiver"][0].get("montantEconPerteVSTarifBase")
|
|
171
|
+
is None
|
|
172
|
+
):
|
|
179
173
|
return None
|
|
174
|
+
return float(self._dpc_data["periodesHiver"][0]["montantEconPerteVSTarifBase"])
|
|
180
175
|
|
|
181
176
|
@property
|
|
182
177
|
@check_dpc_data_present
|
|
@@ -190,11 +185,14 @@ class ContractDPC(ContractResidential):
|
|
|
190
185
|
@property
|
|
191
186
|
@check_dpc_data_present
|
|
192
187
|
def winter_total_days_last_update(self) -> int:
|
|
193
|
-
"""Get number of days since winter starts (calculated from dates).
|
|
188
|
+
"""Get number of days since winter starts (calculated from dates).
|
|
189
|
+
|
|
190
|
+
Returns 0 if last update is before winter start (pre-season setup).
|
|
191
|
+
"""
|
|
194
192
|
winter = self._dpc_data["periodesHiver"][0]
|
|
195
193
|
start = datetime.fromisoformat(winter["dateDebut"].replace("Z", "+00:00"))
|
|
196
194
|
update = datetime.fromisoformat(winter["dateMaj"].replace("Z", "+00:00"))
|
|
197
|
-
return (update - start).days
|
|
195
|
+
return max(0, (update - start).days)
|
|
198
196
|
|
|
199
197
|
@property
|
|
200
198
|
@check_dpc_data_present
|
{hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/hydro_api/client.py
RENAMED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"""HydroQc Client Module."""
|
|
2
2
|
|
|
3
|
+
import asyncio
|
|
3
4
|
import base64
|
|
4
5
|
import csv
|
|
5
6
|
import json
|
|
@@ -7,7 +8,6 @@ import logging
|
|
|
7
8
|
import os
|
|
8
9
|
import platform
|
|
9
10
|
import re
|
|
10
|
-
import ssl
|
|
11
11
|
import uuid
|
|
12
12
|
from collections.abc import Iterator
|
|
13
13
|
from datetime import date, datetime, timedelta
|
|
@@ -114,6 +114,8 @@ class HydroClient:
|
|
|
114
114
|
self.guid: str = str(uuid.uuid1())
|
|
115
115
|
self._logger: logging.Logger = get_logger("httpclient", log_level)
|
|
116
116
|
self._logger.debug("HydroQc initialized")
|
|
117
|
+
# Cache for blocking operations (initialized lazily)
|
|
118
|
+
self._cached_version: str | None = None
|
|
117
119
|
self.reset()
|
|
118
120
|
|
|
119
121
|
def reset(self) -> None:
|
|
@@ -128,20 +130,27 @@ class HydroClient:
|
|
|
128
130
|
self._selected_customer = ""
|
|
129
131
|
self._selected_contract = ""
|
|
130
132
|
|
|
131
|
-
|
|
132
|
-
def user_agent(self) -> str:
|
|
133
|
+
async def _get_user_agent(self) -> str:
|
|
133
134
|
"""Get http client user_agent."""
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
135
|
+
if self._cached_version is None:
|
|
136
|
+
# Run blocking version lookup in executor to avoid blocking event loop
|
|
137
|
+
loop = asyncio.get_event_loop()
|
|
138
|
+
try:
|
|
139
|
+
self._cached_version = await loop.run_in_executor(
|
|
140
|
+
None, version, "Hydro_Quebec_API_Wrapper"
|
|
141
|
+
)
|
|
142
|
+
except PackageNotFoundError:
|
|
143
|
+
# package is not installed
|
|
144
|
+
self._logger.warning(
|
|
145
|
+
"Python package `Hydro_Quebec_API_Wrapper` is not installed. "
|
|
146
|
+
"Install it using pip"
|
|
147
|
+
)
|
|
148
|
+
self._cached_version = "unkwown"
|
|
143
149
|
os_name = platform.system()
|
|
144
|
-
return
|
|
150
|
+
return (
|
|
151
|
+
f"Hydroqc/{self._cached_version} "
|
|
152
|
+
f"(dev@hydroqc.ca; https://gitlab.com/hydroqc) {os_name}"
|
|
153
|
+
)
|
|
145
154
|
|
|
146
155
|
async def http_request(
|
|
147
156
|
self,
|
|
@@ -163,15 +172,10 @@ class HydroClient:
|
|
|
163
172
|
data = {}
|
|
164
173
|
if headers is None:
|
|
165
174
|
headers = {}
|
|
166
|
-
headers["User-Agent"] = self.
|
|
175
|
+
headers["User-Agent"] = await self._get_user_agent()
|
|
167
176
|
if verify_ssl is None:
|
|
168
177
|
verify_ssl = self._verify_ssl
|
|
169
178
|
|
|
170
|
-
ssl_context: ssl.SSLContext | None = None
|
|
171
|
-
if verify_ssl:
|
|
172
|
-
ssl_context = ssl.create_default_context()
|
|
173
|
-
ssl_context.set_ciphers("DEFAULT") # Needed for python3.10
|
|
174
|
-
|
|
175
179
|
# Query Diagnostic
|
|
176
180
|
if self._diag_folder is not None:
|
|
177
181
|
cleaned_url = url.replace("/", "_").replace(":", "").split("#", 1)[0]
|
|
@@ -205,7 +209,7 @@ class HydroClient:
|
|
|
205
209
|
params=params,
|
|
206
210
|
data=data,
|
|
207
211
|
allow_redirects=allow_redirects,
|
|
208
|
-
ssl=
|
|
212
|
+
ssl=verify_ssl,
|
|
209
213
|
headers=headers,
|
|
210
214
|
)
|
|
211
215
|
|
|
File without changes
|
|
File without changes
|
{hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/.devcontainer/devcontainer.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/conflict_test_requirements.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/docs/source/_static/custom.css
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/docs/source/reference/hydroqc.rst
RENAMED
|
File without changes
|
|
File without changes
|
{hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/docs/source/reference/modules.rst
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/contract/__init__.py
RENAMED
|
File without changes
|
{hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/contract/common.py
RENAMED
|
File without changes
|
{hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/contract/contract_d.py
RENAMED
|
File without changes
|
{hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/contract/contract_d_cpc.py
RENAMED
|
File without changes
|
{hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/contract/contract_dt.py
RENAMED
|
File without changes
|
{hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/contract/contract_m.py
RENAMED
|
File without changes
|
{hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/contract/contract_m_gdp.py
RENAMED
|
File without changes
|
|
File without changes
|
{hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/contract/outage.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/hydro_api/__init__.py
RENAMED
|
File without changes
|
{hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/hydro_api/cache.py
RENAMED
|
File without changes
|
{hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/hydro_api/consts.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/peak/basepeakhandler.py
RENAMED
|
File without changes
|
|
File without changes
|
{hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/peak/cpc/__init__.py
RENAMED
|
File without changes
|
{hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/peak/cpc/consts.py
RENAMED
|
File without changes
|
{hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/peak/cpc/handler.py
RENAMED
|
File without changes
|
|
File without changes
|
{hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/peak/dpc/__init__.py
RENAMED
|
File without changes
|
{hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/peak/dpc/consts.py
RENAMED
|
File without changes
|
{hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/hydroqc/peak/dpc/handler.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/tests/subtest_contract_d.py
RENAMED
|
File without changes
|
{hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/tests/subtest_contract_d_cpc.py
RENAMED
|
File without changes
|
{hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/tests/subtest_contract_dpc.py
RENAMED
|
File without changes
|
{hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/tests/subtest_contract_dt.py
RENAMED
|
File without changes
|
{hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/tests/subtest_contract_m.py
RENAMED
|
File without changes
|
{hydro_quebec_api_wrapper-4.2.2 → hydro_quebec_api_wrapper-4.2.4}/tests/subtest_contract_m_gdp.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|