How to use the jikanpy.utils.get_top_url function in jikanpy

To help you get started, we’ve selected a few jikanpy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github AWConant / jikanpy / tests / test_utils.py View on Github external
def test_get_top_url_with_page_and_subtype():
    assert (
        utils.get_top_url(utils.BASE_URL, "Anime", page=2, subtype="upcoming")
        == "https://api.jikan.moe/v3/top/anime/2/upcoming"
    )
github AWConant / jikanpy / tests / test_utils.py View on Github external
def test_get_top_url_with_page():
    assert (
        utils.get_top_url(utils.BASE_URL, "Anime", page=2, subtype=None)
        == "https://api.jikan.moe/v3/top/anime/2"
    )
github AWConant / jikanpy / tests / test_utils.py View on Github external
def test_get_top_url():
    assert (
        utils.get_top_url(utils.BASE_URL, "Anime", page=None, subtype=None)
        == "https://api.jikan.moe/v3/top/anime"
    )
github AWConant / jikanpy / jikanpy / jikan.py View on Github external
type (:obj:`str`): Type to get top items from. Possible values are
                anime and manga.
            page (:obj:`int`, optional): Page number of the results. Defaults to
                None.
            subtype (:obj:`str`, optional): Subtype to get filtered top items.
                Possible values are in the Jikan API documentation.  Defaults to
                None.

        Returns:
            Dict: Dictionary containing top items on MyAnimeList.

        Examples:
            >>> jikan.top(type='manga')
            >>> jikan.top(type='anime', page=2, subtype='upcoming')
        """
        url = utils.get_top_url(self.base, type, page, subtype)
        return self._request(url, type=type)
github AWConant / jikanpy / jikanpy / aiojikan.py View on Github external
type (:obj:`str`): Type to get top items from. Possible values are
                anime and manga.
            page (:obj:`int`, optional): Page number of the results. Defaults to
                None.
            subtype (:obj:`str`, optional): Subtype to get filtered top items.
                Possible values are in the Jikan API documentation.  Defaults to
                None.

        Returns:
            Dict: Dictionary containing top items on MyAnimeList.

        Examples:
            >>> await jikan.top(type='manga')
            >>> await jikan.top(type='anime', page=2, subtype='upcoming')
        """
        url = utils.get_top_url(self.base, type, page, subtype)
        return await self._request(url, type=type)