AccessAPI
This module contains functions and a class for accessing and manipulating a user's manga list on Anilist. It includes functions to get the user ID, retrieve the user's manga list, and get the format of a manga. It also includes the Manga class, which represents a manga with its details.
status_mapping
module-attribute
¶
status_mapping: dict[str, str] = {'reading': 'CURRENT', 'completed': 'COMPLETED', 'on_hold': 'PAUSED', 'dropped': 'DROPPED', 'plan_to_read': 'PLANNING'}
Manga
¶
Manga(name: str, manga_id: int, last_chapter_read: int, private_bool: str, status: str, last_read_at: str, months: str)
Represents a Manga with its details.
ATTRIBUTE | DESCRIPTION |
---|---|
name |
The name of the manga.
TYPE:
|
id |
The ID of the manga.
TYPE:
|
last_chapter_read |
The last chapter of the manga that was read.
TYPE:
|
private_bool |
A boolean indicating whether the manga is private.
TYPE:
|
status |
The status of the manga.
TYPE:
|
last_read_at |
The date and time when the manga was last read.
TYPE:
|
months |
The number of months since the manga was last read.
TYPE:
|
Source code in AnilistMangaUpdater/API/AccessAPI.py
private_bool
instance-attribute
¶
private_bool: Union[bool, None] = True if private_bool == 'Yes' else False if private_bool == 'No' else None
Get_Format
¶
Retrieves the format of a media item from AniList.
PARAMETER | DESCRIPTION |
---|---|
media_id
|
The ID of the media item.
TYPE:
|
app
|
The application object used to send the API request.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
str
|
The format of the media item if the request was successful and
TYPE:
|
Union[str, None]
|
the format is not None, otherwise None. |
Source code in AnilistMangaUpdater/API/AccessAPI.py
Get_User
¶
Retrieves the user ID from the Viewer object.
PARAMETER | DESCRIPTION |
---|---|
app
|
The application object used to send the API request.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
int
|
The user ID if the request was successful and the user ID is not None, otherwise None.
TYPE:
|
Source code in AnilistMangaUpdater/API/AccessAPI.py
Get_User_Manga_List
¶
Retrieves the entire manga list of a user from AniList.
PARAMETER | DESCRIPTION |
---|---|
app
|
The application object used to send the API request.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
list
|
The list of manga, each represented as a dictionary with 'mediaId',
TYPE:
|
list[dict[str, Union[int, str]]]
|
'progress', and 'status' keys. |