How to use the jikanpy.utils.get_main_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_main_url_with_extension_and_page():
    assert (
        utils.get_main_url(utils.BASE_URL, "anime", 2, extension="episodes", page=2)
        == "https://api.jikan.moe/v3/anime/2/episodes/2"
    )
github AWConant / jikanpy / jikanpy / jikan.py View on Github external
def _get(
        self,
        endpoint: str,
        id: int,
        extension: Optional[str],
        page: Optional[int] = None,
    ) -> Dict[str, Any]:
        """Gets the response from Jikan API given the endpoint:
        anime, manga, character, person, club
        """
        url = utils.get_main_url(self.base, endpoint, id, extension, page)
        return self._request(url, id=id, endpoint=endpoint)
github AWConant / jikanpy / jikanpy / aiojikan.py View on Github external
async def _get(
        self,
        endpoint: str,
        id: int,
        extension: Optional[str],
        page: Optional[int] = None,
    ) -> Dict[str, Any]:
        """Gets the response from Jikan API given the endpoint:
        anime, manga, character, person, club
        """
        url = utils.get_main_url(self.base, endpoint, id, extension, page)
        return await self._request(url, id=id, endpoint=endpoint)