Skip to main content

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

statnett-api-client-0.1.5.tar.gz (5.0 kB view hashes)

Uploaded Source

Built Distribution

statnett_api_client-0.1.5-py3-none-any.whl (6.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page