semvec/pypi-packages huggingface dataset:
flanks 0.0.3
Small client for FlanksAPI

# Flanks Python Library
The Flanks Python library provides convenient access to the Flanks API from applications written in the Python language. It includes a pre-defined set of classes for API resources that initialize themselves dynamically from API responses which makes it compatible with a wide range of versions of the Flanks API.

## Documentation

Soon

## Installation

Soon

### Requirements
* Python 3.4+

## Usage

### Initialize Client
Basic usage for initialize the client.

```
import flanks
API_TOKEN = 'TOKEN_API'
flank = Flanks(API_TOKEN)
```

### Create User
Creating users. Fill BANK_USERNAME, BANK_PASSWORD, BANK, BANK_PASSWORD2 with real data.

```
import flanks
API_TOKEN = 'TOKEN_API'
flank = Flanks(API_TOKEN)
username='BANK_USERNAME'
password='BANK_PASSWORD'
bank='BANK'
password2='BANK_PASSWORD2' #If it is necessary
user_token = flank.create_user(username, password, bank, password2)
```


### GET DATA OF USER
You only need one line:

```
    user = flank.get_data(user_token)
```
statnett-api-client 0.1.5
Statnett API Client
Requires Python: >=3.6
Keywords: Statnett,API,Nordic power flow,Nordic power balance

# Statnett API Client

Client presents methods for reading real-time Nordic power balance data provided 
by the Norwegian Transmission System Operator ([statnett.no](https://www.statnett.no/)). 

The full list of topics accessible via Statnett REST API can be seen [here](http://driftsdata.statnett.no/restapi).

Client supports reading of the following topics:

* [Nordic Power Balance](https://www.statnett.no/en/for-stakeholders-in-the-power-industry/data-from-the-power-system/#nordic-power-balance)
* [Nordic Power Flow](https://www.statnett.no/en/for-stakeholders-in-the-power-industry/data-from-the-power-system/#nordic-power-flow)
* [Grid Frequency](https://www.statnett.no/en/for-stakeholders-in-the-power-industry/data-from-the-power-system/#nordic-power-balance)

## Installation

To install the Client, simply use pip:

```
$ pip install statnett_api_client
``` 

## Basic Usage

```python
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. 

```python
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.  

```python
# 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.

```python
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.

```python
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`.   

```python
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.

```python
freq = get_frequency(fmt='pandas', date_from='2019-06-07 21:30')
```

## License

The Client is released under [MIT License](https://github.com/viktorsapozhok/statnett-api-client/blob/master/LICENSE).