The given file contains the class to refer to the tag entity

Module Contents



The given class refers to the tag entity which is created based upon the

class quartic_sdk.core.entities.tag.Tag(body_json, api_helper)

Bases: quartic_sdk.core.entities.base.Base

The given class refers to the tag entity which is created based upon the tag object returned from the API

static raise_exception_for_wavelegths(wavelengths)

Validate wavelengths passed for a spectral tag. Schema as following {“wavelengths” : [‘1460000.0’,’1460001.0]} :param wavelengths: dict containing key as ‘wavelengths’ and value as list of wavelengths


Override the method to return the tag name

data(self, start_time, stop_time, sampling_ratio=1, return_type=Constants.RETURN_PANDAS, batch_size=Constants.DEFAULT_PAGE_LIMIT_ROWS, wavelengths={}, transformations=[])

Get the data for the given tag between the start_time and the 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”

  • wavelengths – dict containing list of wavelengths(string) as value with key “wavelengths” Used for getting data for a spectral tag for specified wavelengths. An example value here is: {“wavelengths:[‘1460000.0’,’1460001.0’]}

  • 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”,



(DataIterator) DataIterator object which can be iterated to get the data between the given duration

wavelengths(self, start_time=None, stop_time=None)

This method is used to get the list of wavelengths of a spectral tag within the provided start and stop times. if start, stop times are not provided, by default it will fetch all available wavelengths. :param: start_time(epoch): Optional :param: stop_time(epoch): Optional :return: dict containing list of wavelengths or error message and status from server

__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 tag.tag_type :return: Either mapped value or raw value with respect to the object attribute