Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

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.

Files for statnett-api-client, version 0.1.5
Filename, size File type Python version Upload date Hashes
Filename, size statnett_api_client-0.1.5-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.5.tar.gz (5.0 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page