https://github.com/kaaproject/python-sdk
https://github.com/kaaproject/python-sdk
Last synced: 23 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/kaaproject/python-sdk
- Owner: kaaproject
- Created: 2019-04-10T15:17:31.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-05-22T09:42:22.000Z (about 7 years ago)
- Last Synced: 2025-01-06T17:51:06.178Z (over 1 year ago)
- Language: Python
- Size: 7.81 KB
- Stars: 0
- Watchers: 10
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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
```