trendminer.views.views module

This module only contains the class Views

class trendminer.views.views.Views(trend_miner_client: trendminer.trendminer_client.TrendMinerClient)

Bases: object

Class to interface with TrendMiner views

load_view(view_id: str, layer_ids: [<class 'int'>] = None) → [<class ‘pandas.core.frame.DataFrame’>]

Loads the time series data of a view into a list of Pandas DataFrames. One DataFrame is returned per layer in the view. Each DataFrame can have a different set of tags available. The optional parameters layer_ids allows you to only load a specified list of layers (identified by the layer ids, as provided by the view_info function).

Parameters
  • view_id – Id of the view to load (mandatory)

  • layer_ids – Optional list of layer ids of the layer to load

Returns

A list of Pandas DataFrames, one for each (selected) layer

view_info(view_id: str)trendminer.views.view_info.ViewInfo

Collect information about a view based on its ID. This info can be used to fetch data from a view: it lists all the layers that are included in the view. When fetching data from the view you can make a selection of layers to be included in the data.

Parameters

view_id – ID of the view for which info is collected

Returns

A ViewInfo object, giving an overview of the included tags and layers in the requested view.

Raises
Returns

Parsed view info