# HydroQC - Hydro Quebec API wrapper
[![coverage report](https://gitlab.com/hydroqc/hydroqc/badges/main/coverage.svg)](https://gitlab.com/hydroqc/hydroqc/-/commits/main)
[![pipeline status](https://gitlab.com/hydroqc/hydroqc/badges/main/pipeline.svg)](https://gitlab.com/hydroqc/hydroqc/-/commits/main)
**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.**
This is a package to access some functionalities of Hydro Quebec API that are not documented.
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
## Donations
We put a lot of heart and effort in this project, any contribution is greatly appreciated!
[![Donate](https://img.shields.io/badge/Donate-Hydroqc-green)](https://hydroqc.ca/en/donations)
## Tested Rates
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.
### Rate D
| Base Rate | Rate Option | Tester | Test result | Last run | Comment |
| - | - | - | - | - | - |
| 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) | |
| 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) | |
| 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 |
| 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) | |
#### Flex D (DPC)
| Base Rate | Rate Option | Tester | Test result | Last run | Comment |
| - | - | - | - | - | - |
| 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) | |
#### Dual Energy (DT)
| Base Rate | Rate Option | Tester | Test result | Last run | Comment |
| - | - | - | - | - | - |
| 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) |
#### Rate M
| Base Rate | Rate Option | Tester | Test result | Last run | Comment |
| - | - | - | - | - | - |
| 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) |
| 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) |
Thanks to [HD Énergie](https://hd.energy) for sponsoring developpement of the Rate M support.
### Other plans
We don't have anyone to test with. Please reach out to us if you have this plan and want to help!
## Documentation
### Code documentation
[https://hydroqc.readthedocs.io/](https://hydroqc.readthedocs.io/)
### Architecture / concepts
If you need more information about the usage and current integrations of the library please see our website [https://hydroqc.ca](https://hydroqc.ca)
## Goal
Make it easy to fetch and manipulate data from Hydro-Quebec, especially the winter credit periods
## Example folder
An example script that extracts the data available from Hydro-Quebec is available in the examples folder.
### Basic setup
This uses python 3.10
1. Clone the repo
```bash
git clone https://gitlab.com/hydroqc/hydroqc.git
```
2. Create a virtual-env
```bash
python -m venv env
. env/bin/activate
pip install --editable .
```
3. Enter your hydro account credentials in the examples/hydro.py file (line 6)
4. Run
```bash
examples/hydro.py
```
## TODO
[https://gitlab.com/groups/hydroqc/-/issues](https://gitlab.com/groups/hydroqc/-/issues)
## Targeted architecture (might change in the future)
```mermaid
classDiagram
WebUser <-- Customer
WebUser <-- HydroClient
Customer <-- Account
Account <-- Contract
Contract <-- HydroClient
Contract <-- Period
Contract <-- Event
Contract <-- WinterCreditHelper
WinterCreditHelper <-- HydroClient
HydroClient <-- Authenticator
class HydroClient{
}
class WinterCreditHelper{
}
class WebUser{
-HydroClient _hydro_client
+List~Customer~ customers
+get_contracts()
}
class Customer{
-HydroClient _hydro_client
+List~Account~ accounts
}
class Account{
-HydroClient _hydro_client
+List~Contract~ contracts
}
class Config{
-string config_file_path
}
class Contract{
-HydroClient _hydro_client
-int customer_id
-int webuser_id
+string subscription_type
+float balance
+list~Period~ periods
+list~Event~ events
+get_winter_credit()
+fetch_periods()
+fetch_summary()
}
class Period{
}
class Event{
}
```
Raw data
{
"_id": null,
"home_page": "https://hydroqc.ca",
"name": "Hydro-Quebec-API-Wrapper",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.10.0",
"maintainer_email": "",
"keywords": "hydroquebec,lib",
"author": "",
"author_email": "Hydroqc Team <info@hydroqc.ca>",
"download_url": "https://files.pythonhosted.org/packages/3b/6c/711ff62ca0e23ac7d13feedb9d16c44116fa6e0c67ec2d8e2d8e68f36918/Hydro-Quebec-API-Wrapper-3.1.3.tar.gz",
"platform": "any",
"description": "# HydroQC - Hydro Quebec API wrapper\n\n\n[![coverage report](https://gitlab.com/hydroqc/hydroqc/badges/main/coverage.svg)](https://gitlab.com/hydroqc/hydroqc/-/commits/main)\n[![pipeline status](https://gitlab.com/hydroqc/hydroqc/badges/main/pipeline.svg)](https://gitlab.com/hydroqc/hydroqc/-/commits/main)\n\n\n\n**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.**\n\nThis is a package to access some functionalities of Hydro Quebec API that are not documented.\n\nWe 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\n\n## Donations\n\nWe put a lot of heart and effort in this project, any contribution is greatly appreciated!\n\n[![Donate](https://img.shields.io/badge/Donate-Hydroqc-green)](https://hydroqc.ca/en/donations)\n\n## Tested Rates\n\nEach 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.\n\n### Rate D\n\n| Base Rate | Rate Option | Tester | Test result | Last run | Comment |\n| - | - | - | - | - | - |\n| 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) | |\n| 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) | |\n| 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 |\n| 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) | |\n\n#### Flex D (DPC)\n\n| Base Rate | Rate Option | Tester | Test result | Last run | Comment |\n| - | - | - | - | - | - |\n| 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) | |\n\n#### Dual Energy (DT)\n\n| Base Rate | Rate Option | Tester | Test result | Last run | Comment |\n| - | - | - | - | - | - |\n| 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) |\n\n#### Rate M\n\n| Base Rate | Rate Option | Tester | Test result | Last run | Comment |\n| - | - | - | - | - | - |\n| 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 \u00c9nergie](https://hd.energy) |\n| 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 \u00c9nergie](https://hd.energy) |\n\nThanks to [HD \u00c9nergie](https://hd.energy) for sponsoring developpement of the Rate M support.\n\n### Other plans\nWe don't have anyone to test with. Please reach out to us if you have this plan and want to help!\n\n## Documentation\n\n### Code documentation\n\n[https://hydroqc.readthedocs.io/](https://hydroqc.readthedocs.io/)\n\n### Architecture / concepts\n\nIf you need more information about the usage and current integrations of the library please see our website [https://hydroqc.ca](https://hydroqc.ca)\n\n## Goal\n\nMake it easy to fetch and manipulate data from Hydro-Quebec, especially the winter credit periods\n\n## Example folder\n\nAn example script that extracts the data available from Hydro-Quebec is available in the examples folder.\n\n### Basic setup\n\nThis uses python 3.10\n\n1. Clone the repo\n\n ```bash\n git clone https://gitlab.com/hydroqc/hydroqc.git\n ```\n\n2. Create a virtual-env\n\n ```bash\n python -m venv env\n . env/bin/activate\n pip install --editable .\n ```\n\n3. Enter your hydro account credentials in the examples/hydro.py file (line 6)\n\n4. Run\n\n ```bash\n examples/hydro.py\n ```\n\n## TODO\n\n[https://gitlab.com/groups/hydroqc/-/issues](https://gitlab.com/groups/hydroqc/-/issues)\n\n## Targeted architecture (might change in the future)\n\n```mermaid\nclassDiagram\n WebUser <-- Customer\n WebUser <-- HydroClient\n\n Customer <-- Account\n\n Account <-- Contract\n\n Contract <-- HydroClient\n Contract <-- Period\n Contract <-- Event\n Contract <-- WinterCreditHelper\n\n WinterCreditHelper <-- HydroClient\n\n\n HydroClient <-- Authenticator\n\n class HydroClient{\n\n }\n class WinterCreditHelper{\n }\n\n class WebUser{\n -HydroClient _hydro_client\n +List~Customer~ customers\n +get_contracts()\n }\n\n class Customer{\n -HydroClient _hydro_client\n +List~Account~ accounts\n }\n\n class Account{\n -HydroClient _hydro_client\n +List~Contract~ contracts\n }\n\n class Config{\n -string config_file_path\n }\n\n class Contract{\n -HydroClient _hydro_client\n -int customer_id\n -int webuser_id\n +string subscription_type\n +float balance\n +list~Period~ periods\n +list~Event~ events\n +get_winter_credit()\n +fetch_periods()\n +fetch_summary()\n }\n\n class Period{\n }\n\n class Event{\n }\n```\n",
"bugtrack_url": null,
"license": "LGPL-3.0-or-later",
"summary": "A wrapper library to access hydro quebec API and more",
"version": "3.1.3",
"project_urls": {
"Bug Reports": "https://gitlab.com/hydroqc/hydroqc/-/issues",
"Homepage": "https://hydroqc.ca",
"Source Code": "https://gitlab.com/hydroqc/hydroqc"
},
"split_keywords": [
"hydroquebec",
"lib"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f5ab48da393b763de1942b674ba4bcaae118f59f5e2372b7b5f1930baba75965",
"md5": "5c5b033060443d00f056f29980f30b22",
"sha256": "f5f632336161ca887bd3ab94b2d17e3b30a2fd56766b7dc7cf2d2be4c1649da7"
},
"downloads": -1,
"filename": "Hydro_Quebec_API_Wrapper-3.1.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5c5b033060443d00f056f29980f30b22",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10.0",
"size": 53776,
"upload_time": "2024-01-19T15:28:51",
"upload_time_iso_8601": "2024-01-19T15:28:51.826144Z",
"url": "https://files.pythonhosted.org/packages/f5/ab/48da393b763de1942b674ba4bcaae118f59f5e2372b7b5f1930baba75965/Hydro_Quebec_API_Wrapper-3.1.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "3b6c711ff62ca0e23ac7d13feedb9d16c44116fa6e0c67ec2d8e2d8e68f36918",
"md5": "827f6764094a973901289ad0cede07e7",
"sha256": "31eab48a38c98764a1605cf75feb00fd8ecb55ccfa13d4c19b753c510ac80c9a"
},
"downloads": -1,
"filename": "Hydro-Quebec-API-Wrapper-3.1.3.tar.gz",
"has_sig": false,
"md5_digest": "827f6764094a973901289ad0cede07e7",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10.0",
"size": 391043,
"upload_time": "2024-01-19T15:28:53",
"upload_time_iso_8601": "2024-01-19T15:28:53.437502Z",
"url": "https://files.pythonhosted.org/packages/3b/6c/711ff62ca0e23ac7d13feedb9d16c44116fa6e0c67ec2d8e2d8e68f36918/Hydro-Quebec-API-Wrapper-3.1.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-01-19 15:28:53",
"github": false,
"gitlab": true,
"bitbucket": false,
"codeberg": false,
"gitlab_user": "hydroqc",
"gitlab_project": "hydroqc",
"lcname": "hydro-quebec-api-wrapper"
}