How to use the jikanpy.utils.get_search_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_search_url():
    assert (
        utils.get_search_url(
            utils.BASE_URL, "anime", "jojo", page=None, parameters=None
        )
        == "https://api.jikan.moe/v3/search/anime?q=jojo"
    )
github AWConant / jikanpy / tests / test_utils.py View on Github external
def test_get_search_url_with_parameters():
    assert (
        utils.get_search_url(
            utils.BASE_URL, "anime", "jojo", page=None, parameters={"a": "x", "b": "y"},
        )
        == "https://api.jikan.moe/v3/search/anime?q=jojo&a=x&b=y"
    )
github AWConant / jikanpy / tests / test_utils.py View on Github external
def test_get_search_url_with_page_and_parameters():
    assert (
        utils.get_search_url(
            utils.BASE_URL, "anime", "jojo", page=2, parameters={"a": "x", "b": "y"},
        )
        == "https://api.jikan.moe/v3/search/anime?q=jojo&page=2&a=x&b=y"
    )
github AWConant / jikanpy / tests / test_utils.py View on Github external
def test_get_search_url_with_page():
    assert (
        utils.get_search_url(utils.BASE_URL, "anime", "jojo", page=2, parameters=None)
        == "https://api.jikan.moe/v3/search/anime?q=jojo&page=2"
    )
github AWConant / jikanpy / jikanpy / aiojikan.py View on Github external
None.
            parameters (:obj:`dict`, optional): Dictionary containing key,value
                pairs for ?key=value in url query. Defaults to None.

        Returns:
            Dict: Dictionary containing search results.

        Examples:
            >>> await jikan.search('anime', 'Jojo')
            >>> await jikan.search('anime', 'Jojo', page=2)
            >>> await jikan.search('anime', 'Jojo', parameters={'type': 'tv'})
            >>> await jikan.search(
                    'anime', 'Jojo', page=2, parameters={'genre': 37, 'type': 'tv'}
                )
        """
        url = utils.get_search_url(self.base, search_type, query, page, parameters)
        kwargs = {"search type": search_type, "query": query}
        return await self._request(url, **kwargs)
github AWConant / jikanpy / jikanpy / jikan.py View on Github external
None.
            parameters (:obj:`dict`, optional): Dictionary containing key,value
                pairs for ?key=value in url query. Defaults to None.

        Returns:
            Dict: Dictionary containing search results.

        Examples:
            >>> jikan.search('anime', 'Jojo')
            >>> jikan.search('anime', 'Jojo', page=2)
            >>> jikan.search('anime', 'Jojo', parameters={'type': 'tv'})
            >>> jikan.search(
                    'anime', 'Jojo', page=2, parameters={'genre': 37, 'type': 'tv'}
                )
        """
        url = utils.get_search_url(self.base, search_type, query, page, parameters)
        kwargs = {"search type": search_type, "query": query}
        return self._request(url, **kwargs)