sailor.sap_iot.fetch
Timeseries module can be used to retrieve timeseries data from the SAP iot abstract timeseries api.
Interfaces for retrieval are aligned with AssetCentral objects such as equipment_set and indicator_set. Timeseries data is generally stored in a pandas dataframe, wrapped in a convenience class to make it easier to interact with the data in AssetCentral terms (see wrappers.py for the convenience class).
- sailor.sap_iot.fetch.get_indicator_data(start_date, end_date, indicator_set, equipment_set, *, timeout=None)[source]
Read indicator data for a certain time period, a set of equipments and a set of indicators.
- Parameters
start_date (Union[str, pd.Timestamp, datetime.timestamp, datetime.date]) – Date of beginning of requested timeseries data. Time components of the date will be ignored.
end_date (Union[str, pd.Timestamp, datetime.timestamp, datetime.date]) – Date of end of requested timeseries data. Time components of the date will be ignored.
indicator_set (IndicatorSet) – IndicatorSet for which timeseries data is returned.
equipment_set (EquipmentSet) – Equipment set for which the timeseries data is read.
timeout (Union[str, pd.Timedelta, datetime.timedelta]) – Maximum amount of time the request may take. If None there is no time limit.
- Return type
Example
Get the indicator set ‘my_indicator_set’ timeseries data for equipments in the equipment set ‘my_equipment_set’ for a period from ‘2020-07-02’ to ‘2021-01-10’:
get_indicator_data('2020-07-02','2021-01-10', my_indicator_set, my_equipment_set)