Exemplo n.º 1
0
    def trending(self, extended=None, **kwargs):
        response = self.http.get('trending', query={'extended': extended})

        items = self.get_data(response, **kwargs)

        if isinstance(items, requests.Response):
            return items

        return SummaryMapper.shows(self.client, items)
Exemplo n.º 2
0
    def trending(self, **kwargs):
        response = self.http.get(
            'trending'
        )

        return SummaryMapper.shows(
            self.client,
            self.get_data(response, **kwargs)
        )
Exemplo n.º 3
0
    def trending(self, **kwargs):
        response = self.http.get('trending', query=dict(**popitems(kwargs, ['extended', 'limit'])))

        items = self.get_data(response, **kwargs)

        if isinstance(items, requests.Response):
            return items

        return SummaryMapper.shows(self.client, items)
Exemplo n.º 4
0
    def trending(self, **kwargs):
        response = self.http.get(
            'trending', query=dict(**popitems(kwargs, ['extended', 'limit'])))

        items = self.get_data(response, **kwargs)

        if isinstance(items, requests.Response):
            return items

        return SummaryMapper.shows(self.client, items)
Exemplo n.º 5
0
    def trending(self, extended=None, **kwargs):
        response = self.http.get('trending', query={
            'extended': extended
        })

        items = self.get_data(response, **kwargs)

        if isinstance(items, requests.Response):
            return items

        return SummaryMapper.shows(self.client, items)
Exemplo n.º 6
0
    def trending(self, extended=None, page=None, per_page=None, **kwargs):
        response = self.http.get('trending',
                                 query={
                                     'extended': extended,
                                     'page': page,
                                     'limit': per_page
                                 },
                                 **dictfilter(kwargs,
                                              get=['exceptions'],
                                              pop=['pagination']))

        # Parse response
        items = self.get_data(response, **kwargs)

        if isinstance(items, PaginationIterator):
            return items.with_mapper(
                lambda items: SummaryMapper.shows(self.client, items))

        if isinstance(items, requests.Response):
            return items

        return SummaryMapper.shows(self.client, items)
Exemplo n.º 7
0
    def get(self, start_date: date, days: int, **kwargs):
        params = ['{:%Y-%m-%d}'.format(start_date), days]

        response = self.http.get(
            params=params,
            **popitems(kwargs, ['authenticated', 'validate_token']))

        items = self.get_data(response, **kwargs)

        if isinstance(items, requests.Response):
            return items

        return SummaryMapper.shows(self.client, items)