How to use the jikanpy.utils.get_genre_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_genre_url():
    assert (
        utils.get_genre_url(utils.BASE_URL, "Anime", 2, page=None)
        == "https://api.jikan.moe/v3/genre/anime/2"
    )
github AWConant / jikanpy / tests / test_utils.py View on Github external
def test_get_genre_url_with_page():
    assert (
        utils.get_genre_url(utils.BASE_URL, "Anime", 2, page=2)
        == "https://api.jikan.moe/v3/genre/anime/2/2"
    )
github AWConant / jikanpy / jikanpy / aiojikan.py View on Github external
Args:
            type (:obj:`str`): Type to get items from. Possible values are anime
                and manga.
            genre_id (:obj:`int`): Genre ID from MyAnimeList.
            page (:obj:`int`, optional): Page number of the results. Defaults to
                None.

        Returns:
            Dict: Dictionary containing anime or manga by genre.

        Examples:
            >>> await jikan.genre(type='anime', genre_id=1)
            >>> await jikan.genre(type='manga', genre_id=2)
        """
        url = utils.get_genre_url(self.base, type, genre_id, page)
        return await self._request(url, id=genre_id, type=type)
github AWConant / jikanpy / jikanpy / jikan.py View on Github external
Args:
            type (:obj:`str`): Type to get items from. Possible values are anime
                and manga.
            genre_id (:obj:`int`): Genre ID from MyAnimeList.
            page (:obj:`int`, optional): Page number of the results. Defaults to
                None.

        Returns:
            Dict: Dictionary containing anime or manga by genre.

        Examples:
            >>> jikan.genre(type='anime', genre_id=1)
            >>> jikan.genre(type='manga', genre_id=2)
        """
        url = utils.get_genre_url(self.base, type, genre_id, page)
        return self._request(url, id=genre_id, type=type)