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.
Source Distribution
Built Distribution
File details
Details for the file statnett-api-client-0.1.5.tar.gz
.
File metadata
- Download URL: statnett-api-client-0.1.5.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4102063d839cb9356953a228bdc72ea2879fb0e88f557c31029f539bbae1a7a5 |
|
MD5 | 16d4924fdd516ecb29c712a6ad181148 |
|
BLAKE2b-256 | 9849b5294f3e9776050afb753bf94f363f028e6d3860fe2d9c81e89d55cf5b28 |
File details
Details for the file statnett_api_client-0.1.5-py3-none-any.whl
.
File metadata
- Download URL: statnett_api_client-0.1.5-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 26526efe59f64692c567d156057c77bf5322b493487018d569b745237f0e2061 |
|
MD5 | 216859c5ea6efdefedd609fbe36ee62b |
|
BLAKE2b-256 | 4d4a4fea4895f8456b18946379cd40cf32a9315f6c6cf398ca0e51aef1305d75 |