tisdb.client module — tisdb 0.0.1.dev0 documentation

# tisdb.client module

class `tisdb.client.` `TsdbClient`(store_type: tisdb.types.StoreType = <StoreType.PORM: 1>, conn_conf: tisdb.config.TsdbConfig = {'autocommit': 0, 'charset': 'utf8', 'cursorclass': <class 'pymysql.cursors.DictCursor'>, 'db': 'icuser', 'host': 'localhost', 'password': 'root', 'port': 3306, 'user': 'root'})

  Bases: `object`

  Tsdb Client

  Args:

    store_type (StoreType): Tsdb store type support PORM,MYSQL,TIDB conn_conf (TsdbConfig): Tsdb connecting configuration

  `create_tsdbdata_mydb`(sql: str, param: Optional[dict] = None, conn_conf: Optional[dict] = None) → List[Dict]

    Create tsdbdata from mydb

    Args:

      sql (str): sql to excute that create ts data param (dict, optional): sql param. Defaults to None. conn_conf (dict, optional): connection config. Defaults to None.

    Returns:

      List[Dict]: ts data created from sql

  `parse`(value: dict) → tisdb.model.TsdbData

    Parse tsdb data from dictionary

    Args:

      value (dict): Tsdb data presents in dict type

    Returns:

      TsdbData: parsed tsdb data

  `parse_many`(values: List[Dict]) → List[tisdb.model.TsdbData]
  `save`(value: tisdb.model.TsdbData, op_type: tisdb.types.OpType = <OpType.UPSERT: 2>) → tisdb.model.SaveResult

    Save timestamp data

    Args:

      value (TsdbData): Timestamp value to save op_type (OpType, optional): Saving operation type. Defaults to OpType.INSERT_IGNORE.

    Returns:

      SaveResult: Result of this save