Statnett API Client
Project description
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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Filename, size | File type | Python version | Upload date | Hashes |
---|---|---|---|---|
Filename, size statnett_api_client-0.1.4-py3-none-any.whl (6.9 kB) | File type Wheel | Python version py3 | Upload date | Hashes View hashes |
Filename, size statnett-api-client-0.1.4.tar.gz (5.0 kB) | File type Source | Python version None | Upload date | Hashes View hashes |
Hashes for statnett_api_client-0.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e816a8f0faee0f9dd1b85b01a3473a869b1bc5644d857be992adda588421da75 |
|
MD5 | d3f2d5ca5c1a788a1d269deca8335200 |
|
BLAKE2-256 | 30980fbf4c63ef6401db2f0cce9b713d9a5f898afd776df1f820efebafc0c6ee |
Hashes for statnett-api-client-0.1.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39c0aeab82d61519909fa77ddd675da933f31910cc72d209354a37750b490326 |
|
MD5 | ae7d62ab4d2fccec45b1a428040a4faa |
|
BLAKE2-256 | 3af2b0873ba6f38ead6760d7b9f67cbf18c776eac1d2f4f66a28b89794a15085 |