def season(self, year: int, season: str) -> Dict[str, Any]: """Gets information on anime of the specific season. Args: year (:obj:`int`): Year to get anime of. season (:obj:`str`): Season to get anime of. Possible values are winter, spring, summer, and fall. Returns: Dict: Dictionary containing information on anime of the season. Examples: >>> jikan.season(year=2018, season='winter') >>> jikan.season(year=2016, season='spring') """ url = utils.get_season_url(self.base, year, season) return self._request(url, year=year, season=season)
def season(self, year: Optional[int] = None, season: Optional[str] = None) -> Dict[str, Any]: """Gets information on anime of the specific season or the current seasaon if no parameters are specified. Args: year (:obj:`int`, optional): Year to get anime of. Defaults to None. season (:obj:`str`, optional): Season to get anime of. Possible values are winter, spring, summer, and fall. Defaults to None. Returns: Dict: Dictionary containing information on anime of the season. Examples: >>> jikan.season() >>> jikan.season(year=2018, season='winter') >>> jikan.season(year=2016, season='spring') """ url = utils.get_season_url(self.base, year, season) return self._request(url, year=year, season=season)
def test_get_season_url(): assert ( utils.get_season_url(utils.BASE_URL, 2020, "Spring") == "https://api.jikan.moe/v3/season/2020/spring" )