API Reference¶
The following sections lines out the Manga class, as well as how to fetch one from the API.
Manga¶
-
class
aiomangadex.
Manga
¶ Represents part of result of https://mangadex.org/api/manga/{id}
-
cover_url
¶ URL to manga cover
Type: string
Type: str
-
chapters
¶ Type: ChapterList
-
session
¶ Type: aiohttp.ClientSession
Warning
Some of the chapter data is not included in the initial fetch, meaning you’ll have to fetch the missing things in
aiomangadex.Chapter
.-
Chapter¶
-
class
aiomangadex.
Chapter
¶ Representation of the chapter model
-
links
¶ - Links to the pages.This is not provided by the api, but put together by the library.
Type: List[str]
-
session
¶ The session passed initially, or the one created by the library if None was passed.
Type: aiohttp.ClientSession
Warning
If this wasn’t fetched through
fetch_chapter()
it is missing some information coming from another API endpoint, like the links to the pages. This is fetched automatically if you usedownload_pages()
ordownload_all_pages()
. To just fetch the missing data, usefetch_pages()
-
download_all_pages
(data_saver: bool = True)¶ Used to download all pages.
Warning
Fast because it runs all download simultaneously. Keep this in mind if you use it often, as you might get banned.
Parameters: data_saver (bool) – Whether to use the data-saver obtion or not. Returns: List of downloaded pages. Return type: List [ io.BytesIO ]
-
download_page
(page: int, data_saver: bool = True)¶ Parameters: Returns: A buffer with the image.
Return type:
-
ChapterList¶
-
class
aiomangadex.
ChapterList
¶ A class used for managing and filtering a Manga Instance’s chapters.
-
filter_chapter_number
(*numbers) → aiomangadex.chapter.ChapterList¶ Filter by chapter number, connected by logical OR. Returns a ChapterList of the chapters with according chapter numbers.
Returns: ChapterList
-
filter_id
(*ids) → aiomangadex.chapter.ChapterList¶ Filter by id, connected by logical OR. Returns ChapterList of chapters with corresponding ids.
Returns: ChapterList
-
filter_language
(*lang) → aiomangadex.chapter.ChapterList¶ Filter by languages, connected by logical OR. Returns a ChapterList of the chapters with corresponding languages.
Returns: ChapterList
-
filter_title
(*titles, difference_cutoff: float = 0.8) → aiomangadex.chapter.ChapterList¶ Filter by titles, connected by logical OR. Returns a ChapterList of the chapters with corresponding titles.
Returns: ChapterList
-
Fetching¶
-
aiomangadex.
fetch_manga
(manga_id: int, session: aiohttp.client.ClientSession = None) → aiomangadex.manga.Manga¶ Used to fetch a manga object by id. :param manga_id: manga id, as in the url :type manga_id: int :param session: It is recommended to create your own Session, especially if you intend to fetch more than one manga. :type session: Optional[ aiohttp.ClientSession ]
Returns: Manga Instance Return type: manga ( aiomangadex.Manga )