Hydro-Quebec-API-Wrapper 0.6.9__tar.gz → 0.8.1__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.
Files changed (126) hide show
  1. {Hydro-Quebec-API-Wrapper-0.6.9 → hydro_quebec_api_wrapper-0.8.1}/.coveragerc +1 -0
  2. hydro_quebec_api_wrapper-0.8.1/.devcontainer/Dockerfile +11 -0
  3. hydro_quebec_api_wrapper-0.8.1/.devcontainer/devcontainer.json +20 -0
  4. {Hydro-Quebec-API-Wrapper-0.6.9 → hydro_quebec_api_wrapper-0.8.1}/.gitignore +20 -0
  5. {Hydro-Quebec-API-Wrapper-0.6.9 → hydro_quebec_api_wrapper-0.8.1}/.gitlab-ci.yml +128 -53
  6. {Hydro-Quebec-API-Wrapper-0.6.9 → hydro_quebec_api_wrapper-0.8.1}/.pre-commit-config.yaml +13 -11
  7. {Hydro-Quebec-API-Wrapper-0.6.9 → hydro_quebec_api_wrapper-0.8.1}/.pylintrc +3 -3
  8. hydro_quebec_api_wrapper-0.8.1/Hydro_Quebec_API_Wrapper.egg-info/PKG-INFO +195 -0
  9. hydro_quebec_api_wrapper-0.8.1/Hydro_Quebec_API_Wrapper.egg-info/SOURCES.txt +103 -0
  10. hydro_quebec_api_wrapper-0.8.1/Hydro_Quebec_API_Wrapper.egg-info/entry_points.txt +2 -0
  11. hydro_quebec_api_wrapper-0.8.1/Hydro_Quebec_API_Wrapper.egg-info/requires.txt +5 -0
  12. hydro_quebec_api_wrapper-0.8.1/MANIFEST.in +2 -0
  13. hydro_quebec_api_wrapper-0.8.1/PKG-INFO +195 -0
  14. hydro_quebec_api_wrapper-0.8.1/README.md +171 -0
  15. {Hydro-Quebec-API-Wrapper-0.6.9 → hydro_quebec_api_wrapper-0.8.1}/config.default.yaml +5 -5
  16. hydro_quebec_api_wrapper-0.8.1/conflict_test_requirements.txt +1 -0
  17. {Hydro-Quebec-API-Wrapper-0.6.9 → hydro_quebec_api_wrapper-0.8.1}/docs/Makefile +1 -1
  18. {Hydro-Quebec-API-Wrapper-0.6.9 → hydro_quebec_api_wrapper-0.8.1}/docs/source/conf.py +19 -16
  19. hydro_quebec_api_wrapper-0.8.1/docs/source/external/description-des-codes-interruption.pdf +0 -0
  20. {Hydro-Quebec-API-Wrapper-0.6.9 → hydro_quebec_api_wrapper-0.8.1}/docs/source/index.rst +0 -1
  21. hydro_quebec_api_wrapper-0.8.1/docs/source/reference/hydroqc.contract.rst +85 -0
  22. {Hydro-Quebec-API-Wrapper-0.6.9 → hydro_quebec_api_wrapper-0.8.1}/docs/source/reference/hydroqc.hydro_api.rst +8 -0
  23. hydro_quebec_api_wrapper-0.8.1/docs/source/reference/hydroqc.peak.cpc.rst +37 -0
  24. hydro_quebec_api_wrapper-0.8.1/docs/source/reference/hydroqc.peak.dpc.rst +37 -0
  25. hydro_quebec_api_wrapper-0.8.1/docs/source/reference/hydroqc.peak.rst +19 -0
  26. {Hydro-Quebec-API-Wrapper-0.6.9 → hydro_quebec_api_wrapper-0.8.1}/docs/source/reference/hydroqc.rst +24 -7
  27. hydro_quebec_api_wrapper-0.8.1/docs/source/reference/hydroqc.types.rst +77 -0
  28. {Hydro-Quebec-API-Wrapper-0.6.9 → hydro_quebec_api_wrapper-0.8.1}/docs/source/todo.rst +0 -1
  29. {Hydro-Quebec-API-Wrapper-0.6.9 → hydro_quebec_api_wrapper-0.8.1}/examples/hydro.py +24 -13
  30. {Hydro-Quebec-API-Wrapper-0.6.9 → hydro_quebec_api_wrapper-0.8.1}/hydroqc/account.py +26 -13
  31. {Hydro-Quebec-API-Wrapper-0.6.9 → hydro_quebec_api_wrapper-0.8.1}/hydroqc/consts.py +2 -2
  32. hydro_quebec_api_wrapper-0.8.1/hydroqc/contract/__init__.py +19 -0
  33. hydro_quebec_api_wrapper-0.8.1/hydroqc/contract/common.py +476 -0
  34. hydro_quebec_api_wrapper-0.8.1/hydroqc/contract/contract_d.py +35 -0
  35. hydro_quebec_api_wrapper-0.8.1/hydroqc/contract/contract_d_cpc.py +52 -0
  36. hydro_quebec_api_wrapper-0.8.1/hydroqc/contract/contract_dpc.py +214 -0
  37. hydro_quebec_api_wrapper-0.8.1/hydroqc/contract/contract_dt.py +56 -0
  38. hydro_quebec_api_wrapper-0.8.1/hydroqc/contract/contract_m.py +75 -0
  39. hydro_quebec_api_wrapper-0.8.1/hydroqc/contract/contract_m_gdp.py +34 -0
  40. hydro_quebec_api_wrapper-0.8.1/hydroqc/contract/contract_residential.py +54 -0
  41. hydro_quebec_api_wrapper-0.8.1/hydroqc/contract/outage.py +111 -0
  42. hydro_quebec_api_wrapper-0.8.1/hydroqc/customer.py +148 -0
  43. hydro_quebec_api_wrapper-0.8.1/hydroqc/diagnostic.py +439 -0
  44. hydro_quebec_api_wrapper-0.8.1/hydroqc/error.py +27 -0
  45. hydro_quebec_api_wrapper-0.8.1/hydroqc/hydro_api/cache.py +50 -0
  46. hydro_quebec_api_wrapper-0.8.1/hydroqc/hydro_api/client.py +1026 -0
  47. hydro_quebec_api_wrapper-0.8.1/hydroqc/hydro_api/consts.py +132 -0
  48. {Hydro-Quebec-API-Wrapper-0.6.9 → hydro_quebec_api_wrapper-0.8.1}/hydroqc/logger.py +10 -1
  49. hydro_quebec_api_wrapper-0.8.1/hydroqc/peak/__init__.py +1 -0
  50. hydro_quebec_api_wrapper-0.8.1/hydroqc/peak/basepeak.py +67 -0
  51. hydro_quebec_api_wrapper-0.8.1/hydroqc/peak/basepeakhandler.py +276 -0
  52. hydro_quebec_api_wrapper-0.8.1/hydroqc/peak/consts.py +3 -0
  53. hydro_quebec_api_wrapper-0.8.1/hydroqc/peak/cpc/__init__.py +1 -0
  54. hydro_quebec_api_wrapper-0.8.1/hydroqc/peak/cpc/consts.py +17 -0
  55. hydro_quebec_api_wrapper-0.8.1/hydroqc/peak/cpc/handler.py +350 -0
  56. {Hydro-Quebec-API-Wrapper-0.6.9/hydroqc/winter_credit → hydro_quebec_api_wrapper-0.8.1/hydroqc/peak/cpc}/peak.py +34 -88
  57. hydro_quebec_api_wrapper-0.8.1/hydroqc/peak/dpc/__init__.py +1 -0
  58. {Hydro-Quebec-API-Wrapper-0.6.9/hydroqc/winter_credit → hydro_quebec_api_wrapper-0.8.1/hydroqc/peak/dpc}/consts.py +2 -8
  59. hydro_quebec_api_wrapper-0.8.1/hydroqc/peak/dpc/handler.py +109 -0
  60. hydro_quebec_api_wrapper-0.8.1/hydroqc/peak/dpc/peak.py +48 -0
  61. hydro_quebec_api_wrapper-0.8.1/hydroqc/public_client.py +88 -0
  62. {Hydro-Quebec-API-Wrapper-0.6.9/hydroqc/winter_credit → hydro_quebec_api_wrapper-0.8.1/hydroqc}/timerange.py +1 -0
  63. hydro_quebec_api_wrapper-0.8.1/hydroqc/types/__init__.py +62 -0
  64. Hydro-Quebec-API-Wrapper-0.6.9/hydroqc/types/info_compte.py → hydro_quebec_api_wrapper-0.8.1/hydroqc/types/account.py +30 -63
  65. hydro_quebec_api_wrapper-0.8.1/hydroqc/types/common.py +80 -0
  66. Hydro-Quebec-API-Wrapper-0.6.9/hydroqc/types/conso.py → hydro_quebec_api_wrapper-0.8.1/hydroqc/types/consump.py +71 -25
  67. hydro_quebec_api_wrapper-0.8.1/hydroqc/types/contract.py +63 -0
  68. Hydro-Quebec-API-Wrapper-0.6.9/hydroqc/types/winter_credit.py → hydro_quebec_api_wrapper-0.8.1/hydroqc/types/cpc.py +9 -7
  69. hydro_quebec_api_wrapper-0.8.1/hydroqc/types/dpc.py +73 -0
  70. hydro_quebec_api_wrapper-0.8.1/hydroqc/types/dt.py +29 -0
  71. hydro_quebec_api_wrapper-0.8.1/hydroqc/types/outage.py +146 -0
  72. hydro_quebec_api_wrapper-0.8.1/hydroqc/utils.py +12 -0
  73. {Hydro-Quebec-API-Wrapper-0.6.9 → hydro_quebec_api_wrapper-0.8.1}/hydroqc/webuser.py +51 -43
  74. {Hydro-Quebec-API-Wrapper-0.6.9 → hydro_quebec_api_wrapper-0.8.1}/pyproject.toml +12 -13
  75. hydro_quebec_api_wrapper-0.8.1/renovate.json5 +140 -0
  76. {Hydro-Quebec-API-Wrapper-0.6.9 → hydro_quebec_api_wrapper-0.8.1}/setup.cfg +5 -4
  77. hydro_quebec_api_wrapper-0.8.1/test_requirements.txt +15 -0
  78. {Hydro-Quebec-API-Wrapper-0.6.9 → hydro_quebec_api_wrapper-0.8.1}/tests/conftest.py +1 -0
  79. hydro_quebec_api_wrapper-0.8.1/tests/subtest_common.py +451 -0
  80. hydro_quebec_api_wrapper-0.8.1/tests/subtest_contract_d.py +84 -0
  81. hydro_quebec_api_wrapper-0.8.1/tests/subtest_contract_d_cpc.py +239 -0
  82. hydro_quebec_api_wrapper-0.8.1/tests/subtest_contract_dpc.py +189 -0
  83. hydro_quebec_api_wrapper-0.8.1/tests/subtest_contract_dt.py +115 -0
  84. hydro_quebec_api_wrapper-0.8.1/tests/subtest_contract_m.py +103 -0
  85. hydro_quebec_api_wrapper-0.8.1/tests/subtest_contract_m_gdp.py +94 -0
  86. hydro_quebec_api_wrapper-0.8.1/tests/test_basic.py +68 -0
  87. {Hydro-Quebec-API-Wrapper-0.6.9 → hydro_quebec_api_wrapper-0.8.1}/tests/test_timerange.py +30 -9
  88. hydro_quebec_api_wrapper-0.8.1/tests/tools.py +127 -0
  89. {Hydro-Quebec-API-Wrapper-0.6.9 → hydro_quebec_api_wrapper-0.8.1}/tox.ini +3 -8
  90. Hydro-Quebec-API-Wrapper-0.6.9/Hydro_Quebec_API_Wrapper.egg-info/PKG-INFO +0 -194
  91. Hydro-Quebec-API-Wrapper-0.6.9/Hydro_Quebec_API_Wrapper.egg-info/SOURCES.txt +0 -64
  92. Hydro-Quebec-API-Wrapper-0.6.9/Hydro_Quebec_API_Wrapper.egg-info/requires.txt +0 -4
  93. Hydro-Quebec-API-Wrapper-0.6.9/MANIFEST.in +0 -2
  94. Hydro-Quebec-API-Wrapper-0.6.9/PKG-INFO +0 -194
  95. Hydro-Quebec-API-Wrapper-0.6.9/README.md +0 -176
  96. Hydro-Quebec-API-Wrapper-0.6.9/conflict_test_requirements.txt +0 -1
  97. Hydro-Quebec-API-Wrapper-0.6.9/docs/source/reference/hydroqc.config.rst +0 -21
  98. Hydro-Quebec-API-Wrapper-0.6.9/docs/source/reference/hydroqc.winter_credit.rst +0 -45
  99. Hydro-Quebec-API-Wrapper-0.6.9/hydroqc/contract.py +0 -270
  100. Hydro-Quebec-API-Wrapper-0.6.9/hydroqc/customer.py +0 -120
  101. Hydro-Quebec-API-Wrapper-0.6.9/hydroqc/error.py +0 -17
  102. Hydro-Quebec-API-Wrapper-0.6.9/hydroqc/hydro_api/cache.py +0 -29
  103. Hydro-Quebec-API-Wrapper-0.6.9/hydroqc/hydro_api/client.py +0 -609
  104. Hydro-Quebec-API-Wrapper-0.6.9/hydroqc/hydro_api/consts.py +0 -83
  105. Hydro-Quebec-API-Wrapper-0.6.9/hydroqc/hydro_api/hydro-chain.pem +0 -55
  106. Hydro-Quebec-API-Wrapper-0.6.9/hydroqc/types/__init__.py +0 -32
  107. Hydro-Quebec-API-Wrapper-0.6.9/hydroqc/winter_credit/__init__.py +0 -1
  108. Hydro-Quebec-API-Wrapper-0.6.9/hydroqc/winter_credit/handler.py +0 -454
  109. Hydro-Quebec-API-Wrapper-0.6.9/renovate.json +0 -69
  110. Hydro-Quebec-API-Wrapper-0.6.9/test_requirements.txt +0 -13
  111. Hydro-Quebec-API-Wrapper-0.6.9/tests/test_basic.py +0 -386
  112. {Hydro-Quebec-API-Wrapper-0.6.9 → hydro_quebec_api_wrapper-0.8.1}/.flake8 +0 -0
  113. {Hydro-Quebec-API-Wrapper-0.6.9 → hydro_quebec_api_wrapper-0.8.1}/Hydro_Quebec_API_Wrapper.egg-info/dependency_links.txt +0 -0
  114. {Hydro-Quebec-API-Wrapper-0.6.9 → hydro_quebec_api_wrapper-0.8.1}/Hydro_Quebec_API_Wrapper.egg-info/top_level.txt +0 -0
  115. {Hydro-Quebec-API-Wrapper-0.6.9 → hydro_quebec_api_wrapper-0.8.1}/LICENSE +0 -0
  116. {Hydro-Quebec-API-Wrapper-0.6.9 → hydro_quebec_api_wrapper-0.8.1}/docs/make.bat +0 -0
  117. {Hydro-Quebec-API-Wrapper-0.6.9 → hydro_quebec_api_wrapper-0.8.1}/docs/source/_static/custom.css +0 -0
  118. {Hydro-Quebec-API-Wrapper-0.6.9 → hydro_quebec_api_wrapper-0.8.1}/docs/source/_static/hydroqc-logo-128.png +0 -0
  119. {Hydro-Quebec-API-Wrapper-0.6.9 → hydro_quebec_api_wrapper-0.8.1}/docs/source/_static/hydroqc-logo.svg +0 -0
  120. {Hydro-Quebec-API-Wrapper-0.6.9 → hydro_quebec_api_wrapper-0.8.1}/docs/source/reference/modules.rst +0 -0
  121. {Hydro-Quebec-API-Wrapper-0.6.9 → hydro_quebec_api_wrapper-0.8.1}/hydroqc/__init__.py +0 -0
  122. {Hydro-Quebec-API-Wrapper-0.6.9 → hydro_quebec_api_wrapper-0.8.1}/hydroqc/hydro_api/__init__.py +0 -0
  123. {Hydro-Quebec-API-Wrapper-0.6.9 → hydro_quebec_api_wrapper-0.8.1}/hydroqc/py.typed +0 -0
  124. {Hydro-Quebec-API-Wrapper-0.6.9 → hydro_quebec_api_wrapper-0.8.1}/logo/hydroqc-logo-128.png +0 -0
  125. {Hydro-Quebec-API-Wrapper-0.6.9 → hydro_quebec_api_wrapper-0.8.1}/logo/hydroqc-logo.svg +0 -0
  126. {Hydro-Quebec-API-Wrapper-0.6.9 → hydro_quebec_api_wrapper-0.8.1}/tests/__init__.py +0 -0
@@ -2,3 +2,4 @@
2
2
  source =
3
3
  ./
4
4
  /builds/*/hydroqc-test/hydroqc/
5
+ /builds/*/*-hydroqc-test/hydroqc/
@@ -0,0 +1,11 @@
1
+ FROM registry.gitlab.com/hydroqc/hydroqc-base-container/3.13:latest
2
+
3
+ # Create devcontainer user with home directory and bash shell, install sudo, and configure passwordless sudo
4
+ RUN useradd -m -s /bin/bash devcontainer \
5
+ && apt-get update && apt-get install -y sudo gnulib locales \
6
+ && echo "devcontainer ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/devcontainer
7
+
8
+ WORKDIR /home/devcontainer
9
+ USER devcontainer
10
+ RUN mkdir -p /home/devcontainer/.local/bin \
11
+ && export PATH=$PATH:/home/devcontainer/.local/bin
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "hydroqc",
3
+ "build": {
4
+ "dockerfile": "Dockerfile"
5
+ },
6
+ "features": {
7
+ "ghcr.io/devcontainers/features/docker-in-docker:2": {},
8
+ "ghcr.io/msclock/features/gitlab-ci-local:0": {
9
+ "version": "latest"
10
+ }
11
+ },
12
+ "customizations": {
13
+ "vscode": {
14
+ "extensions": [
15
+ "GitLab.gitlab-workflow"
16
+ ]
17
+ }
18
+ },
19
+ "remoteUser": "devcontainer"
20
+ }
@@ -124,9 +124,29 @@ venv.bak/
124
124
  .mypy_cache/
125
125
  .dmypy.json
126
126
  dmypy.json
127
+ mypy-html-report/
128
+ mypy-junit.xml
129
+ mypy-txt-report/
130
+ classes.html
131
+ packages.html
127
132
 
128
133
  # Pyre type checker
129
134
  .pyre/
130
135
  /hydro-env/
131
136
  config.yaml
132
137
  .idea/
138
+
139
+ # gitlab-ci-local
140
+ .gitlab-ci-local-env
141
+ .gitlab-ci-local/
142
+ .gitlab-ci-local-variables.yml
143
+
144
+ # Tests results
145
+ mypy*
146
+ packages.html
147
+ classes.html
148
+
149
+
150
+ diagnostic.zip
151
+ /diagnostic/
152
+
@@ -1,26 +1,38 @@
1
+ include:
2
+ - project: "renovate-bot/renovate-runner"
3
+ file: "/templates/renovate-config-validator.gitlab-ci.yml"
1
4
  variables:
2
5
  TWINE_USERNAME: __token__
3
6
  PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
4
7
  stages:
5
- - test
6
- - private_tests
7
- - private_tests_done
8
- - pypi
8
+ - test
9
+ - private_tests
10
+ - private_tests_done
11
+ - pypi
9
12
 
10
13
  cache:
11
14
  key: pip-cache
12
15
  paths:
13
16
  - .cache/pip
14
17
 
15
- test:
18
+ renovate-config-validator:
16
19
  stage: test
17
20
  tags:
18
- - hydroqc
19
- image: registry.gitlab.com/hydroqc/hydroqc-base-container/build:20221121
21
+ - hydroqc
22
+ rules:
23
+ # Enable for all other branches if it's a MR pipeline
24
+ - if: "$CI_COMMIT_REF_NAME != $CI_DEFAULT_BRANCH && $CI_MERGE_REQUEST_IID"
25
+ changes:
26
+ - renovate.json5
27
+ when: on_success
28
+ - when: never
29
+
30
+ test:
31
+ stage: test
32
+ # tags:
33
+ # - hydroqc
34
+ image: registry.gitlab.com/hydroqc/hydroqc-base-container/3.13:latest
20
35
  script:
21
- #- apt-get update && apt-get install git --no-install-recommends -y graphviz jq python3.10 python3-venv python3-pip git
22
- - cat renovate.json |jq > /dev/null 2&>1 || ( echo "renovate.json not valid" && exit 1 )
23
- #- pip install tox
24
36
  - tox -e pylint,flake8,pydocstyle,typing,black,deps-conflict --parallel auto
25
37
  - cat mypy-txt-report/index.txt
26
38
  artifacts:
@@ -36,21 +48,30 @@ test:
36
48
  - packages.mmd
37
49
  - packages.html
38
50
  rules:
39
- - if: '$CI_SKIP =~ /test/'
51
+ # Disable if CI_SKIP is set
52
+ - if: "$CI_SKIP =~ /test/"
40
53
  when: never
41
- - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
42
- #when: never
43
- - if: '$CI_COMMIT_TAG'
54
+ # Disable if it's a tag pipeline
55
+ - if: "$CI_COMMIT_TAG"
44
56
  when: never
45
- - when: on_success
57
+ # Enabled for main branch
58
+ - if: "$CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH"
59
+ when: on_success
60
+ # Enable for all other branches if it's a MR pipeline
61
+ - if: "$CI_COMMIT_REF_NAME != $CI_DEFAULT_BRANCH && $CI_MERGE_REQUEST_IID"
62
+ when: on_success
63
+ # Make it manual for external MR
64
+ - if: "$CI_MERGE_REQUEST_IID && $CI_MERGE_REQUEST_PROJECT_PATH != $CI_MERGE_REQUEST_SOURCE_PROJECT_PATH"
65
+ when: manual
66
+ - when: never
46
67
 
47
68
  .private_test_script: &private_test_script
48
69
  stage: private_tests
49
- tags:
50
- - hydroqc
51
- image: registry.gitlab.com/hydroqc/hydroqc-base-container/build:20221121
70
+ # Run on shared runners to lighten the load on the private runners
71
+ # tags:
72
+ # - hydroqc
73
+ image: registry.gitlab.com/hydroqc/hydroqc-base-container/3.13:latest
52
74
  script:
53
- #- apt update && apt install -y jq unzip curl
54
75
  - >
55
76
  OUTPUT=$(curl
56
77
  --globoff
@@ -146,67 +167,100 @@ test:
146
167
  reports:
147
168
  junit: hydroqc/tests_result_junit.*.xml
148
169
  rules:
149
- - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
150
- #when: never
151
- - if: '$CI_COMMIT_TAG'
170
+ # Disable if it's a tag pipeline
171
+ - if: "$CI_COMMIT_TAG"
152
172
  when: never
153
- - when: on_success
154
-
173
+ # Enabled for main branch
174
+ - if: "$CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH"
175
+ when: on_success
176
+ # Enable for all other branches if it's a MR pipeline
177
+ - if: "$CI_COMMIT_REF_NAME != $CI_DEFAULT_BRANCH && $CI_MERGE_REQUEST_IID"
178
+ when: on_success
179
+ # Make it manual for external MR
180
+ - if: "$CI_MERGE_REQUEST_IID && $CI_MERGE_REQUEST_PROJECT_PATH != $CI_MERGE_REQUEST_SOURCE_PROJECT_PATH"
181
+ when: manual
182
+ - when: never
155
183
 
156
- private_test_titilambert:
184
+ D_CPC_titilambert:
157
185
  variables:
158
186
  PROJECT_ID: 35085986
159
187
  <<: *private_test_script
160
188
  rules:
161
- - if: '$CI_SKIP =~ /titilambert/'
189
+ - if: "$CI_SKIP =~ /d_cpc_titilambert/"
162
190
  when: never
163
191
  - !reference [.private_test_script, rules]
164
192
 
165
- private_test_mdallaire1:
193
+ DPC_mdallaire1:
166
194
  variables:
167
195
  PROJECT_ID: 39503160
168
196
  <<: *private_test_script
169
197
  rules:
170
- - if: '$CI_SKIP =~ /mdallaire1/'
198
+ - if: "$CI_SKIP =~ /dpc_mdallaire1/"
199
+ when: never
200
+ - !reference [.private_test_script, rules]
201
+
202
+ DT_mdallaire1:
203
+ variables:
204
+ PROJECT_ID: 52729124
205
+ <<: *private_test_script
206
+ rules:
207
+ - if: "$CI_SKIP =~ /dt_mdallaire1/"
208
+ when: never
209
+ - !reference [.private_test_script, rules]
210
+
211
+ D_mdallaire1:
212
+ variables:
213
+ PROJECT_ID: 52728916
214
+ <<: *private_test_script
215
+ rules:
216
+ - if: "$CI_SKIP =~ /d_mdallaire1/"
171
217
  when: never
172
218
  - !reference [.private_test_script, rules]
173
219
 
174
- private_test_weimdall:
220
+ D_weimdall:
175
221
  variables:
176
222
  PROJECT_ID: 39038345
177
223
  <<: *private_test_script
178
224
  rules:
179
- - if: '$CI_SKIP =~ /weimdall/'
225
+ - if: "$CI_SKIP =~ /d_weimdall/"
180
226
  when: never
181
227
  - !reference [.private_test_script, rules]
182
228
 
183
- private_test_zepiaf:
229
+ D_CPC_zepiaf:
184
230
  variables:
185
231
  PROJECT_ID: 39098670
186
232
  <<: *private_test_script
187
233
  rules:
188
- - if: '$CI_SKIP =~ /zepiaf/'
234
+ - if: "$CI_SKIP =~ /d_cpc_zepiaf/"
189
235
  when: never
190
236
  - !reference [.private_test_script, rules]
191
237
 
192
- private_test_devzwf:
238
+ D_devzwf:
193
239
  variables:
194
240
  PROJECT_ID: 39310934
195
241
  <<: *private_test_script
196
242
  rules:
197
- - if: '$CI_SKIP =~ /devzwf/'
243
+ - if: "$CI_SKIP =~ /d_devzwf/"
244
+ when: never
245
+ - !reference [.private_test_script, rules]
246
+
247
+ M_hdenergy:
248
+ variables:
249
+ PROJECT_ID: 41155894
250
+ <<: *private_test_script
251
+ rules:
252
+ - if: "$CI_SKIP =~ /m_hdenergy/"
198
253
  when: never
199
254
  - !reference [.private_test_script, rules]
200
255
 
201
256
  private_tests_done:
202
257
  stage: private_tests_done
203
258
  tags:
204
- - hydroqc
205
- image: registry.gitlab.com/hydroqc/hydroqc-base-container/build:20221121
259
+ - hydroqc
260
+ image: registry.gitlab.com/hydroqc/hydroqc-base-container/3.13:latest
206
261
  script:
207
262
  #- apt-get update && apt-get install --no-install-recommends -y python3.10 python3-venv python3-pip --no-install-recommends git
208
263
  - echo "Private Tests done"
209
- #- pip install tox
210
264
  - find .
211
265
  - mv -v hydroqc/.coverage* .
212
266
  - mv -v hydroqc/*.xml .
@@ -224,19 +278,28 @@ private_tests_done:
224
278
  - "*-badge.svg"
225
279
  - "*-job-end-date.svg"
226
280
  rules:
227
- - if: '$CI_SKIP =~ /done/'
281
+ # Disable if CI_SKIP is set
282
+ - if: "$CI_SKIP =~ /done/"
228
283
  when: never
229
- - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
230
- #when: never
231
- - if: '$CI_COMMIT_TAG'
284
+ # Disable if it's a tag pipeline
285
+ - if: "$CI_COMMIT_TAG"
232
286
  when: never
233
- - when: on_success
287
+ # Enabled for main branch
288
+ - if: "$CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH"
289
+ when: on_success
290
+ # Enable for all other branches if it's a MR pipeline
291
+ - if: "$CI_COMMIT_REF_NAME != $CI_DEFAULT_BRANCH && $CI_MERGE_REQUEST_IID"
292
+ when: on_success
293
+ # Make it manual for external MR
294
+ - if: "$CI_MERGE_REQUEST_IID && $CI_MERGE_REQUEST_PROJECT_PATH != $CI_MERGE_REQUEST_SOURCE_PROJECT_PATH"
295
+ when: manual
296
+ - when: never
234
297
 
235
298
  package:
236
299
  stage: test
237
300
  tags:
238
- - hydroqc
239
- image: registry.gitlab.com/hydroqc/hydroqc-base-container/build:20221121
301
+ - hydroqc
302
+ image: registry.gitlab.com/hydroqc/hydroqc-base-container/3.13:latest
240
303
  script:
241
304
  # Build a package with a version based on the commmit short sha
242
305
  - pip install --upgrade pip
@@ -245,19 +308,31 @@ package:
245
308
  - python3 -m twine check --strict dist/*
246
309
  - TWINE_PASSWORD=${CI_JOB_TOKEN} TWINE_USERNAME=gitlab-ci-token python3 -m twine upload --verbose --repository-url ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi dist/*
247
310
  rules:
248
- - if: '$CI_SKIP =~ /package/'
311
+ # Disable if CI_SKIP is set
312
+ - if: "$CI_SKIP =~ /package/"
313
+ when: never
314
+ # Disable if it's a tag pipeline
315
+ - if: "$CI_COMMIT_TAG"
249
316
  when: never
250
- - if: '$CI_COMMIT_TAG'
317
+ # Disable if it's a scheduled pipeline
318
+ - if: "$CI_PIPELINE_SOURCE == 'schedule'"
251
319
  when: never
252
- - if: '$CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
320
+ # Enabled for main branch
321
+ - if: "$CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH"
322
+ when: on_success
323
+ # Enable for all other branches if it's a MR pipeline
324
+ - if: "$CI_COMMIT_REF_NAME != $CI_DEFAULT_BRANCH && $CI_MERGE_REQUEST_IID"
253
325
  when: on_success
326
+ # Make it manual for external MR
327
+ - if: "$CI_MERGE_REQUEST_IID && $CI_MERGE_REQUEST_PROJECT_PATH != $CI_MERGE_REQUEST_SOURCE_PROJECT_PATH"
328
+ when: manual
254
329
  - when: never
255
330
 
256
331
  promote2pypi:
257
332
  stage: pypi
258
333
  tags:
259
- - hydroqc
260
- image: registry.gitlab.com/hydroqc/hydroqc-base-container/build:20221121
334
+ - hydroqc
335
+ image: registry.gitlab.com/hydroqc/hydroqc-base-container/3.13:latest
261
336
  script:
262
337
  # TODO: try to pull the good package from gitlab pypi repo
263
338
  # then change the version (promote)
@@ -272,17 +347,17 @@ promote2pypi:
272
347
  #- |
273
348
  # pip download Hydro-Quebec-API-Wrapper --extra-index-url https://gitlab.com/api/v4/projects/${CI_PROJECT_ID}/packages/pypi/simple --no-deps
274
349
  # TODO: open archives edit versions and rebuild archive
275
- #- cd ..
276
- #- apt-get update && apt-get install --no-install-recommends -y python3.10 python3-venv python3-pip git
350
+
277
351
  # Build package that could be promoted
278
352
  - pip install --upgrade pip
279
353
  - pip install --upgrade build setuptools_scm twine
280
354
  - python3 -m build -o dist
281
355
  - python3 -m twine check --strict dist/*
282
356
  - twine upload --verbose --non-interactive --repository pypi dist/*
357
+ - TWINE_PASSWORD=${CI_JOB_TOKEN} TWINE_USERNAME=gitlab-ci-token python3 -m twine upload --verbose --repository-url ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi dist/*
283
358
  rules:
284
- - if: '$CI_SKIP =~ /pypi/'
359
+ - if: "$CI_SKIP =~ /pypi/"
285
360
  when: never
286
- - if: '$CI_COMMIT_TAG'
361
+ - if: "$CI_COMMIT_TAG"
287
362
  when: on_success
288
363
  - when: never
@@ -1,6 +1,6 @@
1
1
  repos:
2
2
  - repo: https://github.com/pre-commit/pre-commit-hooks
3
- rev: v4.3.0
3
+ rev: v6.0.0
4
4
  hooks:
5
5
  - id: trailing-whitespace
6
6
  - id: end-of-file-fixer
@@ -16,38 +16,40 @@ repos:
16
16
  - id: check-ast
17
17
 
18
18
  - repo: https://github.com/psf/black
19
- rev: 22.10.0
19
+ rev: 25.12.0
20
20
  hooks:
21
21
  - id: black
22
22
  language_version: python3
23
23
 
24
24
  - repo: https://github.com/PyCQA/flake8/
25
- rev: 5.0.4
25
+ rev: 7.3.0
26
26
  hooks:
27
27
  - id: flake8
28
28
  additional_dependencies: [flake8-docstrings]
29
29
 
30
30
  - repo: https://github.com/PyCQA/isort
31
- rev: 5.10.1
31
+ rev: 7.0.0
32
32
  hooks:
33
33
  - id: isort
34
34
  args: ["--profile", "black", "--filter-files"]
35
35
  # additional_dependencies: [toml]
36
36
 
37
37
  - repo: https://github.com/PyCQA/doc8
38
- rev: v1.0.0
38
+ rev: v2.0.0
39
39
  hooks:
40
40
  - id: doc8
41
41
 
42
42
  - repo: https://github.com/pre-commit/mirrors-mypy
43
- rev: v0.981
43
+ rev: v1.19.1
44
44
  hooks:
45
45
  - id: mypy
46
46
  args: [--strict, --pretty, --show-error-codes]
47
47
  additional_dependencies:
48
- - "types-pytz==2022.6.0.1"
49
- - "types-PyYAML==6.0.12.2"
50
- - "types-python-dateutil==2.8.19.4"
48
+ - "types-pytz==2025.2.0.20251108"
49
+ - "types-PyYAML==6.0.12.20250915"
50
+ - "types-python-dateutil==2.9.0.20260124"
51
51
  - "pytest-stub==1.1.0"
52
- - "aiohttp==3.8.3"
53
- - "aiocache==0.11.1"
52
+ - "aiohttp==3.13.3"
53
+ - "aiocache==0.12.3"
54
+ - "pkce==1.0.3"
55
+ - "pytest-asyncio==1.3.0"
@@ -239,7 +239,7 @@ max-returns=10
239
239
  max-branches=20
240
240
 
241
241
  # Maximum number of statements in function / method body
242
- max-statements=80
242
+ max-statements=70
243
243
 
244
244
  # Maximum number of parents for a class (see R0901).
245
245
  max-parents=7
@@ -251,7 +251,7 @@ max-attributes=25
251
251
  min-public-methods=1
252
252
 
253
253
  # Maximum number of public methods for a class (see R0904).
254
- max-public-methods=30
254
+ max-public-methods=40
255
255
 
256
256
 
257
257
  [IMPORTS]
@@ -276,7 +276,7 @@ int-import-graph=
276
276
 
277
277
  # Exceptions that will emit a warning when being caught. Defaults to
278
278
  # "Exception"
279
- overgeneral-exceptions=Exception
279
+ overgeneral-exceptions=builtins.Exception
280
280
 
281
281
  max-nested-blocks=7
282
282
  max-bool-expr=10
@@ -0,0 +1,195 @@
1
+ Metadata-Version: 2.4
2
+ Name: Hydro-Quebec-API-Wrapper
3
+ Version: 0.8.1
4
+ Summary: A wrapper library to access hydro quebec API and more
5
+ Home-page: https://hydroqc.ca
6
+ Author-email: Hydroqc Team <info@hydroqc.ca>
7
+ License: LGPL-3.0-or-later
8
+ Project-URL: Source Code, https://gitlab.com/hydroqc/hydroqc
9
+ Project-URL: Bug Reports, https://gitlab.com/hydroqc/hydroqc/-/issues
10
+ Project-URL: Home-page, https://hydroqc.ca
11
+ Keywords: hydroquebec,lib
12
+ Platform: any
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Operating System :: OS Independent
15
+ Requires-Python: >=3.12.0
16
+ Description-Content-Type: text/markdown
17
+ License-File: LICENSE
18
+ Requires-Dist: aiohttp<4.0.0,>=3.10.0
19
+ Requires-Dist: python-dateutil>=2.8.0
20
+ Requires-Dist: pytz>=2024.1
21
+ Requires-Dist: aiocache>=0.12.0
22
+ Requires-Dist: pkce>=1.0.3
23
+ Dynamic: license-file
24
+
25
+ # HydroQC - Hydro Quebec API wrapper
26
+
27
+
28
+ [![coverage report](https://gitlab.com/hydroqc/hydroqc/badges/main/coverage.svg)](https://gitlab.com/hydroqc/hydroqc/-/commits/main)
29
+ [![pipeline status](https://gitlab.com/hydroqc/hydroqc/badges/main/pipeline.svg)](https://gitlab.com/hydroqc/hydroqc/-/commits/main)
30
+
31
+
32
+
33
+ **This is a library to use if you want to build your own solution. If you want a user-friendly implementation for your home automation system please use [hydroqc2mqtt](https://gitlab.com/hydroqc/hydroqc2mqtt) which provide a MQTT publisher, docker image and HASS addon.**
34
+
35
+ This is a package to access some functionalities of Hydro Quebec API that are not documented.
36
+
37
+ We started a discord server for the project where you can come to discuss and find help with the project on our [#development](https://discord.gg/NWnfdfRZ7T) channel
38
+
39
+ ## Donations
40
+
41
+ We put a lot of heart and effort in this project, any contribution is greatly appreciated!
42
+
43
+ [![Donate](https://img.shields.io/badge/Donate-Hydroqc-green)](https://hydroqc.ca/en/donations)
44
+
45
+ ## Tested Rates
46
+
47
+ Each account, contracts and rates are different and we do our best to integrate all available options. Currently the account combinations listed below are supported and tested automaticaly by our CI/CD pipeline. If your account scenario is not currently tested and listed as **Needed** feel free to reach out to us on our discord [#development](https://discord.gg/NWnfdfRZ7T) channel if you want to volunter for testing. We provide a way to setup CI/CD tests in your own account in a way that keep your account info private to you (more details [here](https://gitlab.com/hydroqc/hydroqc-test-template)). Keep in mind that this process is a bit involved technicaly so it is best if you have some working knowledge with Gitlab.
48
+
49
+ ### Rate D
50
+
51
+ | Base Rate | Rate Option | Tester | Test result | Last run | Comment |
52
+ | - | - | - | - | - | - |
53
+ | D | - | @weimdall | ![Test Result](https://gitlab.com/api/v4/projects/hydroqc%2Fhydroqc/jobs/artifacts/main/raw/39038345-badge.svg?job=private_tests_done) | ![Timestamp](https://gitlab.com/api/v4/projects/hydroqc%2Fhydroqc/jobs/artifacts/main/raw/39038345-job-end-date.svg?job=private_tests_done) | |
54
+ | D | - | @mdallaire1 | ![Test Result](https://gitlab.com/api/v4/projects/hydroqc%2Fhydroqc/jobs/artifacts/main/raw/52728916-badge.svg?job=private_tests_done) | ![Timestamp](https://gitlab.com/api/v4/projects/hydroqc%2Fhydroqc/jobs/artifacts/main/raw/52728916-job-end-date.svg?job=private_tests_done) | |
55
+ | D | - | @devzwf | ![Test Result](https://gitlab.com/api/v4/projects/hydroqc%2Fhydroqc/jobs/artifacts/main/raw/39310934-badge.svg?job=private_tests_done) | ![Timestamp](https://gitlab.com/api/v4/projects/hydroqc%2Fhydroqc/jobs/artifacts/main/raw/39310934-job-end-date.svg?job=private_tests_done) | Hilo |
56
+ | D | CPC | @titilambert |![Test Result](https://gitlab.com/api/v4/projects/hydroqc%2Fhydroqc/jobs/artifacts/main/raw/35085986-badge.svg?job=private_tests_done) | ![Timestamp](https://gitlab.com/api/v4/projects/hydroqc%2Fhydroqc/jobs/artifacts/main/raw/35085986-job-end-date.svg?job=private_tests_done) | |
57
+
58
+ #### Flex D (DPC)
59
+
60
+ | Base Rate | Rate Option | Tester | Test result | Last run | Comment |
61
+ | - | - | - | - | - | - |
62
+ | DPC | - | @mdallaire1 | ![Test Result](https://gitlab.com/api/v4/projects/hydroqc%2Fhydroqc/jobs/artifacts/main/raw/39503160-badge.svg?job=private_tests_done) | ![Timestamp](https://gitlab.com/api/v4/projects/hydroqc%2Fhydroqc/jobs/artifacts/main/raw/39503160-job-end-date.svg?job=private_tests_done) | |
63
+
64
+ #### Dual Energy (DT)
65
+
66
+ | Base Rate | Rate Option | Tester | Test result | Last run | Comment |
67
+ | - | - | - | - | - | - |
68
+ | DT | - | @mdallaire1 | ![Test Result](https://gitlab.com/api/v4/projects/hydroqc%2Fhydroqc/jobs/artifacts/main/raw/52729124-badge.svg?job=private_tests_done) | ![Timestamp](https://gitlab.com/api/v4/projects/hydroqc%2Fhydroqc/jobs/artifacts/main/raw/52729124-job-end-date.svg?job=private_tests_done) |
69
+
70
+ #### Rate M
71
+
72
+ | Base Rate | Rate Option | Tester | Test result | Last run | Comment |
73
+ | - | - | - | - | - | - |
74
+ | M | - | @hdenergy | ![Test Result](https://gitlab.com/api/v4/projects/hydroqc%2Fhydroqc/jobs/artifacts/main/raw/41155894-badge.svg?job=private_tests_done) | ![Timestamp](https://gitlab.com/api/v4/projects/hydroqc%2Fhydroqc/jobs/artifacts/main/raw/39503160-job-end-date.svg?job=private_tests_done) | [HD Énergie](https://hd.energy) |
75
+ | M | GDP | @hdenergy | ![Test Result](https://gitlab.com/api/v4/projects/hydroqc%2Fhydroqc/jobs/artifacts/main/raw/41155894-badge.svg?job=private_tests_done) | ![Timestamp](https://gitlab.com/api/v4/projects/hydroqc%2Fhydroqc/jobs/artifacts/main/raw/39503160-job-end-date.svg?job=private_tests_done) | [HD Énergie](https://hd.energy) |
76
+
77
+ Thanks to [HD Énergie](https://hd.energy) for sponsoring developpement of the Rate M support.
78
+
79
+ ### Other plans
80
+ We don't have anyone to test with. Please reach out to us if you have this plan and want to help!
81
+
82
+ ## Documentation
83
+
84
+ ### Code documentation
85
+
86
+ [https://hydroqc.readthedocs.io/](https://hydroqc.readthedocs.io/)
87
+
88
+ ### Architecture / concepts
89
+
90
+ If you need more information about the usage and current integrations of the library please see our website [https://hydroqc.ca](https://hydroqc.ca)
91
+
92
+ ## Goal
93
+
94
+ Make it easy to fetch and manipulate data from Hydro-Quebec, especially the winter credit periods
95
+
96
+ ## Example folder
97
+
98
+ An example script that extracts the data available from Hydro-Quebec is available in the examples folder.
99
+
100
+ ### Basic setup
101
+
102
+ This uses python 3.10
103
+
104
+ 1. Clone the repo
105
+
106
+ ```bash
107
+ git clone https://gitlab.com/hydroqc/hydroqc.git
108
+ ```
109
+
110
+ 2. Create a virtual-env
111
+
112
+ ```bash
113
+ python -m venv env
114
+ . env/bin/activate
115
+ pip install --editable .
116
+ ```
117
+
118
+ 3. Enter your hydro account credentials in the examples/hydro.py file (line 6)
119
+
120
+ 4. Run
121
+
122
+ ```bash
123
+ examples/hydro.py
124
+ ```
125
+
126
+ ## TODO
127
+
128
+ [https://gitlab.com/groups/hydroqc/-/issues](https://gitlab.com/groups/hydroqc/-/issues)
129
+
130
+ ## Targeted architecture (might change in the future)
131
+
132
+ ```mermaid
133
+ classDiagram
134
+ WebUser <-- Customer
135
+ WebUser <-- HydroClient
136
+
137
+ Customer <-- Account
138
+
139
+ Account <-- Contract
140
+
141
+ Contract <-- HydroClient
142
+ Contract <-- Period
143
+ Contract <-- Event
144
+ Contract <-- WinterCreditHelper
145
+
146
+ WinterCreditHelper <-- HydroClient
147
+
148
+
149
+ HydroClient <-- Authenticator
150
+
151
+ class HydroClient{
152
+
153
+ }
154
+ class WinterCreditHelper{
155
+ }
156
+
157
+ class WebUser{
158
+ -HydroClient _hydro_client
159
+ +List~Customer~ customers
160
+ +get_contracts()
161
+ }
162
+
163
+ class Customer{
164
+ -HydroClient _hydro_client
165
+ +List~Account~ accounts
166
+ }
167
+
168
+ class Account{
169
+ -HydroClient _hydro_client
170
+ +List~Contract~ contracts
171
+ }
172
+
173
+ class Config{
174
+ -string config_file_path
175
+ }
176
+
177
+ class Contract{
178
+ -HydroClient _hydro_client
179
+ -int customer_id
180
+ -int webuser_id
181
+ +string subscription_type
182
+ +float balance
183
+ +list~Period~ periods
184
+ +list~Event~ events
185
+ +get_winter_credit()
186
+ +fetch_periods()
187
+ +fetch_summary()
188
+ }
189
+
190
+ class Period{
191
+ }
192
+
193
+ class Event{
194
+ }
195
+ ```