Statnett API Client
Client presents methods for reading real-time Nordic power balance data provided by the Norwegian Transmission System Operator (statnett.no).
The full list of topics accessible via Statnett REST API can be seen here.
Client supports reading of the following topics:
Installation
To install the Client, simply use pip:
$ pip install statnett_api_client
Basic Usage
from statnett_api_client import get_flow, get_balance, get_frequency
# read power flow
flow = get_flow(fmt='pandas')
# read balance data
balance = get_balance(fmt='pandas')
# read grid frequency
freq = get_frequency(fmt='pandas')
Getting topics in a loop
You can use get_topic method for iterating over different topics.
from statnett_api_client import get_topic
for topic in ['flow', 'balance', 'frequency']:
data = get_topic(topic, fmt='pandas')
Parameters
You can specify format of returned object using fmt parameter.
# this will return flow in json format
flow = get_flow(fmt='json')
# this will return pandas dataframe
flow = get_flow(fmt='pandas')
Specify date2index if you want to add dates to dataframe index.
balance = get_balance(fmt='pandas', date2index=True)
By default, the time is in UTC. To add a column with Central European Time (CET),
you need to specify time_cet parameter.
freq = get_frequency(fmt='pandas', date2index=True, time_cet=True)
Sometimes it can be useful to add hour column to result dataframe. It can be achieved by
specifying add_hour parameter. If time_cet is True, then two columns are added,
hour_utc and hour_cet.
flow = get_flow(fmt='pandas', time_cet=True, add_hour=True)
To get frequency data for time period, you need to scecify date_from parameter. Supports only for
frequency topic.
freq = get_frequency(fmt='pandas', date_from='2019-06-07 21:30')
License
The Client is released under MIT License.
Release files for statnett-api-client 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| statnett-api-client-0.1.5.tar.gz | 5.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| statnett_api_client-0.1.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.8 kB
Release files / statnett-api-client-0.1.5.tar.gz
| Download URL | statnett-api-client-0.1.5.tar.gz |
|---|---|
| Size | 5.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4102063d839cb9356953a228bdc72ea2879fb0e88f557c31029f539bbae1a7a5
|
|
BLAKE2b-256 checksum How to use checksums |
9849b5294f3e9776050afb753bf94f363f028e6d3860fe2d9c81e89d55cf5b28
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.5.0.1 requests/2.18.4 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7
|
Release files / statnett_api_client-0.1.5-py3-none-any.whl
| Download URL | statnett_api_client-0.1.5-py3-none-any.whl |
|---|---|
| Size | 6.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
26526efe59f64692c567d156057c77bf5322b493487018d569b745237f0e2061
|
|
BLAKE2b-256 checksum How to use checksums |
4d4a4fea4895f8456b18946379cd40cf32a9315f6c6cf398ca0e51aef1305d75
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.5.0.1 requests/2.18.4 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7
|