Esempio n. 1
0
    async def ttrating(self, cust_id, category) -> \
            chart_data.ChartData[chart_data.TTRating]:
        """ Utilizes the stats_chart class to return a list of ttrating values
        that are used in the /CareerStats charts.
        """
        chart_type = ct.ChartType.ttrating.value
        response = await self._stats_chart(cust_id, category, chart_type)

        ttrating_list = []
        for ttrating in response.json():
            ttrating_list.append(
                chart_data.TTRating(timestamp=ttrating[0], value=ttrating[1]))

        return chart_data.ChartData(category=category,
                                    type=chart_type,
                                    content=ttrating_list)
Esempio n. 2
0
    async def irating(self, cust_id, category) -> \
            chart_data.ChartData[chart_data.IRating]:
        """ Utilizes the stats_chart class to return a list of iRating values
        that are used in the /CareerStats charts. Accessing
        get_irating().current() will give the most recent irating of a cust_id
        """
        chart_type = ct.ChartType.irating.value
        response = await self._stats_chart(cust_id, category, chart_type)
        ir_list = []
        for irating in response.json():
            ir_list.append(
                chart_data.IRating(timestamp=irating[0], value=irating[1]))

        return chart_data.ChartData(category=category,
                                    type=chart_type,
                                    content=ir_list)
Esempio n. 3
0
    async def license_class(self, cust_id, category) -> \
            chart_data.ChartData[chart_data.LicenseClass]:
        """ Utilizes the stats_chart class to return a list of license values
        that are used in the /CareerStats charts. See the LicenseClass class
        for how to further use this data.
        """
        chart_type = ct.ChartType.license_class.value
        response = await self._stats_chart(cust_id, category, chart_type)

        license_class_list = []
        for license_class in response.json():
            license_class_list.append(
                chart_data.LicenseClass(timestamp=license_class[0],
                                        license_number=license_class[1]))

        return chart_data.ChartData(category=category,
                                    type=chart_type,
                                    content=license_class_list)