Skip to content

shaikhzhas/tszhas

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TSIClient

Build Status codecov Documentation Status Codacy Badge PyPI PyPI - Downloads

The TSIClient is a Python SDK for Microsoft Azure time series insights. It provides methods to conveniently retrieve your data and is designed for analysts, data scientists and developers working with time series data in Azure TSI.

Documentation

Installation

We recommended to use a Python version >= 3.6. You can install the TSIClient from PyPi:

pip install TSIClient

Or if you want to get the latest code, directly fom GitHub:

pip install git+https://github.com/RaaLabs/TSIClient.git

Quickstart

Instantiate the TSIClient to query your TSI environment. Use the credentials from your service principal in Azure that has access to the TSI environment (you can also use environment variables to instantiate the TSIClient, check the documentation).

from TSIClient import TSIClient as tsi

client = tsi.TSIClient(
    enviroment="<your-tsi-env-name>",
    client_id="<your-client-id>",
    client_secret="<your-client-secret>",
    tenant_id="<your-tenant-id>",
    applicationName="<your-app-name>">
)

You can query your timeseries data by timeseries id, timeseries name or timeseries description. The Microsoft TSI apis support aggregation, so you can specify a sampling freqency and an aggregation method. Refer to the documentation for detailed information.

data = client.getDataById(
    timeseries=["timeseries_id1", "timeseries_id2"],
    timespan=["2019-12-12T15:35:11.68Z", "2019-12-12T17:02:05.958Z"],
    interval="PT5M",
    aggregate="avg",
    useWarmStore=False
)

This returns a pandas dataframe, which can be used for analysis.

Contributing

Contributions are welcome. See the developer reference for details.

License

TSIClient is licensed under the MIT license. See LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages