:mod:`quartic_sdk.core.iterators.tag_data_iterator` =================================================== .. py:module:: quartic_sdk.core.iterators.tag_data_iterator Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: quartic_sdk.core.iterators.tag_data_iterator.TagDataIterator .. class:: TagDataIterator(tags, start_time, stop_time, total_count, batch_size, api_helper, sampling_ratio=1, return_type=Constants.RETURN_JSON, wavelengths={}, transformations=[]) The given class is the iterator class, which will be used to iterate for getting the tag data values at the given intervals .. method:: raise_exception_for_transformation_schema(transformations, tags) :staticmethod: We validate the transformations schema. Its schema would be like the following: [{"transformation_type": "interpolation", "column": "1", "method": "linear"}, {"transformation_type": "aggregation", "aggregation_column": "2", "aggregation_dict": {"1":{"1":"max"},"2":{"2":"std"}}}] :param transformations: List of transformations in the schema as above :param tags: List of tag ids :return: (None) Does not return anything, raises exception if validation fails .. method:: create_post_data(self) We create the required post data which will be used for making the POST call .. method:: __iter__(self) Return the data iterator with the data fetch state set at 0 .. method:: __next__(self) Get the next object in the iteration. Note that the return object is inclusive of time ranges .. method:: create_tag_data_iterator(cls, tags, start_time, stop_time, api_helper, sampling_ratio=1, return_type=Constants.RETURN_PANDAS, batch_size=Constants.DEFAULT_PAGE_LIMIT_ROWS, wavelengths={}, transformations=[]) :classmethod: The method creates the TagDataIterator instance based upon the parameters that are passed here :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" :param 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']} :param 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", }] :return: (DataIterator) DataIterator object which can be iterated to get the data between the given duration