Class Reference¶
Client¶
-
class
tokage.
Client
(session=None, *, lib='asyncio', loop=None)¶ Client connection to the MAL API. This class is used to interact with the API.
Parameters: - session (Optional[Union[aiohttp.ClientSession, asks.Session]]) –
The session to use for aiohttp/asks requests.
Defaults to creating a new one.
- lib (Optional[str]) – The async library to use Tokage with. Defaults to asyncio. Valid libraries: asyncio, multio.
- loop (Optional[asyncio.BaseEventLoop]) –
For use with asyncio. The event loop to use for aiohttp.
Defaults to creating a new one.
-
session
¶ Union[aiohttp.ClientSession, asks.Session] – The session used for aiohttp/asks HTTP requests.
-
coroutine
get_anime
(target_id)¶ Retrieves an
Anime
object from an IDRaises a
AnimeNotFound
Error if an Anime was not found corresponding to the ID.
-
coroutine
get_character
(target_id)¶ Retrieves a
Character
object from an IDRaises a
CharacterNotFound
Error if a Character was not found corresponding to the ID.
-
coroutine
get_manga
(target_id)¶ Retrieves a
Manga
object from an IDRaises a
MangaNotFound
Error if a Manga was not found corresponding to the ID.
-
coroutine
get_person
(target_id)¶ Retrieves a
Person
object from an IDRaises a
PersonNotFound
Error if a Person was not found corresponding to the ID.
-
coroutine
search_anime
(query)¶ Search for
PartialAnime
by query.Returns a list of results.
-
coroutine
search_character
(query)¶ Search for
PartialCharacter
by query.Returns a list of results.
-
coroutine
search_id
(type_, query)¶ Parse a google query and return the ID.
Raises a
TokageNotFound
Error if an ID was not found.
-
coroutine
search_manga
(query)¶ Search for
PartialManga
by query.Returns a list of results.
-
coroutine
search_person
(query)¶ Search for
PartialPerson
by query.Returns a list of results.
- session (Optional[Union[aiohttp.ClientSession, asks.Session]]) –
Base Classes¶
Warning
Do not create these yourself. You’ll recieve them by way of getter functions.
Anime¶
-
class
tokage.
Anime
(anime_id, data, **kwargs)¶ Represents a MAL Anime
-
id
¶ int – The Anime’s ID.
-
title
¶ str – The Series title.
-
type
¶ str – The Anime’s type. Can be ONA/OVA/TV/Movie.
-
synonyms
¶ list[str] – Alternative names for the Anime.
-
image
¶ str – The cover image URL for the Anime.
-
japanese_title
¶ str – Japanese title of the Anime.
-
status
¶ str – Airing status of the Manga.
-
episodes
¶ int – Episode count of the Manga.
-
air_start
¶ str – Airing start date.
-
air_end
¶ str – Airing end date.
-
airing
¶ bool – True if the Anime is airing, False if not.
-
synopsis
¶ str – Description of the Anime.
-
producers
¶ list[list] – WIP - List of the Anime’s producers.
-
licensors
¶ list[list] – WIP - List of the Anime’s licensors.
-
studios
¶ list[list] – WIP - List of the Anime’s studios
-
premiered
¶ str – Premier season.
-
broadcast
¶ str – Broadcast times.
-
genres
¶ list[str] – List of the Anime’s genres.
-
link
¶ str – Link to the Anime on MAL.
-
score
¶ tuple(int) – Tuple of (score, voters).
-
duration
¶ str – Duration of the Anime (may be per episode).
-
rank
¶ int – Anime’s rank on the MAL board.
-
popularity
¶ int – Popularity rank of the Anime.
-
members
¶ int – Amount of members which have the Anime in their list.
-
favorites
¶ int – Amount of favorites given to the Anime.
-
source
¶ str – Type of source material. Can be Manga Novel or Original.
list[
PartialAnime
orPartialManga
] – List of related Anime or Manga.
-
Manga¶
-
class
tokage.
Manga
(manga_id, data, **kwargs)¶ Represents a MAL Manga (Includes Novels)
-
id
¶ int – The Manga’s ID.
-
title
¶ str – The Series title.
-
type
¶ str – The Manga’s type. Can be either “Novel” or “Manga”.
-
synonyms
¶ list[str] – Alternative names for the Manga.
-
image
¶ str – The cover image URL for the Manga.
-
japanese_title
¶ str – Japanese title of the Manga.
-
status
¶ str – Publishing status of the Manga.
-
volumes
¶ int – Volume count of the Manga.
-
chapters
¶ int – Chapter count of the Manga.
-
publish_start
¶ str – Publication start date.
-
publish_end
¶ str – Publication end date.
-
publishing
¶ bool – True if the manga is publishing, False if not.
-
synopsis
¶ str – Description of the Manga.
PartialPerson
– PartialPerson instance of the Manga author.
-
serialization
¶ str – The Manga’s serialization.
-
genres
¶ list[str] – List of the Manga’s genres.
-
link
¶ str – Link to the Manga on MAL.
-
score
¶ tuple(int) – Tuple of (score, voters).
-
rank
¶ int – Manga’s rank on the MAL board.
-
popularity
¶ int – Popularity rank of the Manga.
-
members
¶ int – Amount of members which have the Manga in their list.
-
favorites
¶ int – Amount of favorites given to the Manga.
list[
PartialAnime
orPartialManga
] – List of related Anime or Manga.
-
Character¶
-
class
tokage.
Character
(char_id, data, **kwargs)¶ Represents a MAL Character
-
id
¶ int – The Character’s ID.
-
name
¶ str – Character’s name.
-
link
¶ str – Link to the Character on MAL.
-
image
¶ str – Image URL of the Character.
-
favorites
¶ int – Amount of favorites the Character has.
-
animeography
¶ list[
PartialAnime
] – Anime the Character is featured in.
-
mangaography
¶ list[
PartialManga
] – Manga the Character is featured in.
-
japanese_name
¶ str – Japanese name of the character.
-
about
¶ str – WIP - Information about the character. As of now, spoilers are unformatted and will appear.
-
voice_actors
¶ list[
PartialPerson
] – List of voice actors who played this Character.
-
Person¶
-
class
tokage.
Person
(person_id, data, **kwargs)¶ Represents a MAL Person (Voice Actors, Staff, etc.)
-
id
¶ int – The Person’s ID.
-
name
¶ str – The Person’s name.
-
link
¶ str – Link to the Person on MAL.
-
image
¶ str – Image URL of the Person.
-
favorites
¶ int – Amount of favorites the Person has.
-
anime
¶ list[
PartialAnime
] – Staff positions in Anime.
-
manga
¶ list[
PartialManga
] – Published Manga.
-
more
¶ str – Additional info about the Person.
-
website
¶ str – Link to the Person’s website
-
voice_acting
¶ list[
PartialCharacter
] – List of characters the Person has voice acted.
-
Partial Classes¶
PartialAnime¶
PartialManga¶
PartialCharacter¶
-
class
tokage.
PartialCharacter
(name, id, url, **kwargs)¶ Represents a part of a Character object
-
name
¶ str – The Character’s name.
-
id
¶ int – The Character’s ID.
-
url
¶ str – Link to the Character.
-
anime
¶ Optional[
PartialAnime
] – The anime this character is from.
-
coroutine
request_full
()¶ Request an instance of the full, non-partial class. For example,
PartialAnime
->Anime
-
PartialPerson¶
-
class
tokage.
PartialPerson
(name, id, url, **kwargs)¶ Represents a part of a Person object
-
name
¶ str – The Person’s name.
-
id
¶ int – The Person’s ID.
-
url
¶ str – Link to the Person.
-
language
¶ Optional[str] – If this is a partial voice actor, the language of the voice acting.
-
coroutine
request_full
()¶ Request an instance of the full, non-partial class. For example,
PartialAnime
->Anime
-