quartic_sdk.core.entities.asset
¶
The given file contains the class to refer to the asset entity
Module Contents¶
Classes¶
The given class refers to the asset entity which is created based upon the |
-
class
quartic_sdk.core.entities.asset.
Asset
(body_json, api_helper)¶ Bases:
quartic_sdk.core.entities.base.Base
The given class refers to the asset entity which is created based upon the asset object returned from the API
-
mapping
¶
-
__repr__
(self)¶ Override the method to return the asset name
The given method returns the list of tags for the given asset :param query_params: Dictionary of filter conditions
-
event_frames
(self, query_params={})¶ The given method returns the list of event frames for the given asset :param query_params: Dictionary of filter conditions
-
batches
(self, query_params={})¶ The given method returns the list of batches for the given asset :param query_params: Dictionary of filter conditions
-
data
(self, start_time, stop_time, sampling_ratio=1, return_type=Constants.RETURN_PANDAS, batch_size=Constants.DEFAULT_PAGE_LIMIT_ROWS, transformations=[])¶ Get the data of all tags in the asset between the given start_time and stop_time for the given sampling_ratio :param start_time: (epoch) Start_time for getting data :param stop_time: (epoch) Stop_time for getting data :param sampling_ratio: sampling_ratio of the data :param return_type: The param decides whether the data after querying will be
json(when value is “json”) or pandas dataframe(when value is “pd”). By default, it takes the value as “json”
- Parameters
transformations –
Refers to the list of transformations. It supports either interpolation or aggregation, depending upon which, we pass the value of this dictionary. If transformation_type is “aggregation”, an optional key can be passed called aggregation_timestamp, which determines how the timestamp information will be retained after aggregation. Valid options are “first”, “last” or “discard”. By default, the last timestamp in each group will be retained. An example value here is: [{
”transformation_type”: “interpolation”, “column”: “3”, “method”: “linear”
- }, {
“transformation_type”: “aggregation”, “aggregation_column”: “4”, “aggregation_dict”: {“3”: “max”}, “aggregation_timestamp”: “last”,
}]
- Returns
(DataIterator) DataIterator object which can be iterated to get the data between the given duration
-
__getattribute__
(self, name)¶ This method overrides the python’s object __getattribute__ method. This is used to map some constant value of an object to some meaningful string constants for better readability :param name: name of the object attribute we want to access for example asset.status :return: Either mapped value or raw value with respect to the object attribute
-