Oma Helen API library and CLI
Project description
Oma Helen CLI
An interactive CLI to use Oma Helen from your command line. Offers an API client to get contract data and electricity measurements in JSON format.
What is Oma Helen?
Oma Helen is the user portal for a Finnish electricity company, Helen Oy.
How to install and use
Install from pypi and run:
pip install oma-helen-cli
oma-helen-cli
Then just enter you Oma Helen credentials and start entering commands.
Tip: in order to list all the commands within the CLI, enter ?
Available functions
| Function name | What it does |
|---|---|
| get_api_access_token | Get the access token to the Oma Helen API. With the token, you can make manual curl requests to the API |
| get_contract_base_price | Get the monthly base price of your current electricity contract |
| get_contract_data_json | Returns the whole contract data as JSON. Will return all active contracts you have with Helen |
| get_daily_measurements_json | Returns your daily energy consumption for the on-going month of the on-going year as JSON |
| get_market_prices_json | Returns the prices for the Market Price Electricity contract as JSON. The JSON includes the price for last month, the current month and next month if available |
| get_monthly_measurements_json | Returns your monthly energy consumption for the on-going year as JSON |
| calculate_the_impact_of_usage_between_dates | Calculates your impact of usage (in c/kwh) between given dates for the Helen Smart Electricity Guarantee |
| calculate_spot_cost_between_dates | Calculates the total costs (eur) between given dates of a spot price contract in an hourly precision |
| get_exchange_margin_price_json | Get the margin price of the Exchange Electricity contract |
| get_contract_energy_unit_price | Get the energy unit price (c/kwh) from your contract data. Note that this only works for fixed price contracts. For spot electricity contract, this returns 0.0 |
| get_contract_transfer_fee | Get the transfer fees (c/kwh) from your contract. Note that if Helen is not your transfer company, this returns 0.0 |
| calculate_transfer_fees_between_dates | Calculates total transfer fees (eur) based on your consumption between dates |
| get_contract_transfer_base_price | Get the monthly transfer base price (eur) from your contract. Note that if Helen is not your transfer company, this returns 0.0 |
| get_all_delivery_sites | Get all delivery sites across your active contracts |
| get_all_gsrn_ids | Get all GSRN ids across your active contracts |
| select_delivery_site | Select a delivery site by id for the CLI to use. Accepts both GSRN ids and delivery site ids as input. Useful if you have multiple contracts with Helen. Use get_all_delivery_sites or get_all_gsrn_ids to find out all your delivery sites / GSRN ids. After selecting a delivery site, all measurements and other requested data will be about the selected delivery site. |
Installing from sources and running the project for local development
First clone this repo.
Use virtual env to keep the project isolated. Developed using Python 3.9.9
- In the project root folder run
python -m venv .venv - Activate the venv with
source .venv/bin/activate - Install requirements
pip install -r requirements.txt - Launch the CLI as a python module
python -m helenservice.cli - Enter your username and password as they are prompted
- Type
?into the CLI prompt to see all available functions
Deactivate venv when not needed: deactivate
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file oma_helen_cli-1.3.4.tar.gz.
File metadata
- Download URL: oma_helen_cli-1.3.4.tar.gz
- Upload date:
- Size: 14.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
63fdd3dbd72a69a47d19ec131ed3a5838fb0901ed826f77a1e1033f213df4112
|
|
| MD5 |
3801516c8f68db25d2ad25d8313b5766
|
|
| BLAKE2b-256 |
609810682b2c1c98a79dcf20efd5a0c643033974b171b3289c7fc860edac830f
|
File details
Details for the file oma_helen_cli-1.3.4-py3-none-any.whl.
File metadata
- Download URL: oma_helen_cli-1.3.4-py3-none-any.whl
- Upload date:
- Size: 15.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e8d3650e272bcd0ae4b98bae8297a52f68a891d35b77907133a8d7c9f6e73d2
|
|
| MD5 |
39eafeef6e03c03373f10100a41d5996
|
|
| BLAKE2b-256 |
cee3c5bb06f74f2d676bd7e790b347f90d23187b00cea004c03f43d2d1c71447
|