An unofficial class to interact with the Seas-NVE API
Project description
PySeasNVE
An unofficial class to interact (read-only) with the Seas-NVE API
You’ll need to own an account over at https://seas-nve.dk/
Free software: GNU General Public License v3
Documentation: https://pyseasnve.readthedocs.io.
Features
Current pricing & climate stats
Forecasts for pricing and climate stats
The next cheapest/greenest/mixed period (for any given intervals)
TODO:
Billing stats?
Long-term stats (i.e. weekly/monthly/yearly usage) (50% done)
Possibility to set configuration values via the API
Usage
# Install
python3 -m pip install -U pyseasnve
# Login
>>> from pyseasnve import PySeasNVE
>>> seas = PySeasNVE('test@email.com', 'secretPassword')
# Current price + climate stats
>>> seas.current_price()
1.68 # DKK/kWh
>>> seas.current_green_energy()
75.68 # %
>>> seas.current_co2_intensity()
188 # gCO2eq/kWh
# Get the price & climate at some hour
>>> seas.price_at(9)
{'start_time': '2022-03-26T09:00:00', 'kwh_raw_price': 1.48, 'kwh_tariffs': 1.56, 'kwh_total': 3.04}
>>> seas.price_at("2022-03-26T18:00:00")
{'start_time': '2022-03-26T18:00:00', 'kwh_raw_price': 2.44, 'kwh_tariffs': 2.05, 'kwh_total': 4.49}
>>> seas.climate_at(26)
{'start_time': '2022-03-27T02:00:00', 'green_energy_percent': 68.7, 'co2_intensity': 251, 'consumption_breakdown_percent': {'biomass': 23.94, 'coal': 21.6, 'gas': 8.36, 'geothermal': 0.0, 'hydro': 1.7, 'nuclear': 7.22, 'oil': 0.0, 'solar': 2.83, 'wind': 33.0, 'unknown': 1.35}}
# Next two cheapest 4-hour intervals
>>> seas.cheapest_interval(4, 2)
[{'start_time': '2022-03-20T12:00:00', 'interval_hours': 4, 'interval_avg_kwh_price': 1.59, 'interval_avg_kwh_price_estimate': False, 'interval_avg_green_energy_percent': 75.68, 'interval_avg_green_energy_percent_estimate': False}, {'start_time': '2022-03-20T11:00:00', 'interval_hours': 4, 'interval_avg_kwh_price': 1.6, 'interval_avg_kwh_price_estimate': False, 'interval_avg_green_energy_percent': 75.68, 'interval_avg_green_energy_percent_estimate': False}]
# Next greenest 1-hour interval
>>> seas.greenest_interval(1, 1)
[{'start_time': '2022-03-20T12:00:00', 'interval_hours': 1, 'interval_avg_kwh_price': 1.57, 'interval_avg_kwh_price_estimate': False, 'interval_avg_green_energy_percent': 75.68, 'interval_avg_green_energy_percent_estimate': False}]
# Or simply use the "best" method, depending on your motivation in SEAS-NVE
>>> seas.best_interval()
[{'start_time': '2022-03-20T12:00:00', 'interval_hours': 1, 'interval_avg_kwh_price': 1.57, 'interval_avg_kwh_price_estimate': False, 'interval_avg_green_energy_percent': 75.68, 'interval_avg_green_energy_percent_estimate': False}, {'start_time': '2022-03-20T13:00:00', 'interval_hours': 1, 'interval_avg_kwh_price': 1.57, 'interval_avg_kwh_price_estimate': False, 'interval_avg_green_energy_percent': 75.68, 'interval_avg_green_energy_percent_estimate': False}, {'start_time': '2022-03-20T14:00:00', 'interval_hours': 1, 'interval_avg_kwh_price': 1.57, 'interval_avg_kwh_price_estimate': False, 'interval_avg_green_energy_percent': 75.68, 'interval_avg_green_energy_percent_estimate': False}]
You can access the forecasts directly aswell, to write you own wrapper code around it. If you find something is missing, please raise an issue or submit the code :-)
>>> seas.forecast_price()
# output not shown
>>> seas.forecast_climate()
# output not shown
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
History
0.2.0 (2022-03-27)
BREAKING: renamed kwh_tax to kwh_tariffs - as that is what it is :-)
Fixed an error on forecast.price() when the API doesn’t return all keys
Added initial work on consumption stats
0.1.1 (2022-03-26)
Updated docs
Added two unit tests
0.1.0 (2022-03-15)
First release on PyPI.
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
Hashes for pyseasnve-0.2.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22da5cadad03da0bb9bea6f344f972867849ddcab6f169ae18228cc9351cd3e2 |
|
MD5 | 55ecfd001e1c88601b9678d8f97bd03b |
|
BLAKE2b-256 | 21464d285010fe99c4cbb33c146ad62c22775a203e959d172f48369be137b782 |