An open API service indexing awesome lists of open source software.

https://github.com/kaaproject/python-sdk


https://github.com/kaaproject/python-sdk

Last synced: 23 days ago
JSON representation

Awesome Lists containing this project

README

          

# Welcome to Kaa Python SDK

Current version of Kaa Python SDK covers authentication management and provides programmatic access for timeseries REST API.

# Supported python versions

Python 3.6 and higher

# How to use

### Step 1 - Set credentials

```python
from kaa_sdk.config import set_credentials_file, set_config_file

set_credentials_file(uname='',
password='',
client_id='',
client_secret='')
set_config_file(host='',
auth_host='',
realm='')
```

### Step 2 - explore available commands

#### Examples:

##### Get configs
```python
from kaa_sdk.epts.v1.api import get_time_series_config

get_time_series_config()

```

##### Get last time series
```python
from kaa_sdk.epts.v1.api import get_last_time_series

get_last_time_series("", ["humidity", "temperature"])

```

##### Get time series
```python
from datetime import datetime, timedelta

from kaa_sdk.epts.v1.api import get_time_series

now = datetime.now()
then = now - timedelta(days=2)
json_resp = get_time_series("", ["humidity"], then, now, [""], "ASC")

```

### Also help available for each command

#### Examples:

```
help(get_time_series_config)

Help on function get_time_series_config in module kaa_sdk.epts.v1.api:

get_time_series_config(application_names=None)
Returns configurations of all time series.

:param application_names: Application name, one or multiple. If not specified,
the data is returned for all available applications.
:return: json with time series configuration
```