The following section outlines the reference of myanimelistpy.
Methods |
---|
:ref:`getAnimeList <getanimelist>` |
:ref:`getAnimeListInDict <getanimelistindict>` |
:ref:`getAnimeListInJSON <getanimelistinjson>` |
- Parameters:
- client_id (str) - MyAnimeList Client ID.
.. method:: getAnimeList(anime_name, limit = 100, offset = 0, fields = [])
Returns a list of anime by name.
- Parameters:
- anime_name(str) - Name of the anime/series.
- limit(Optional[int]) - The maximum size of the list. The default value is 100.
- offset(Optional[int]) - The list offset. The default value is 0.
- fields(Optional[List [str]]) - List of fields used to show more information about the anime. If is empty, the default fields are id, title and main_picture.
- Raises:
- ValueError - The 'field' is not a valid field!
- Returns:
- List of animes.
- Return type:
- List [:ref:`Anime <anime>`]
.. method:: getAnimeListInDict(anime_name, limit = 100, offset = 0, fields = [])
Returns a list of dictionaries containing the anime by name.
- Parameters:
- anime_name(str) - Name of the anime/series.
- limit(Optional[int]) - The maximum size of the list. The default value is 100.
- offset(Optional[int]) - The list offset. The default value is 0.
- fields(Optional[List [str]]) - List of fields used to show more information about the anime. If is empty, the default fields are id, title and main_picture.
- Raises:
- ValueError - The 'field' is not a valid field!
- Returns:
- List of animes in dict type.
- Return type:
- dict
.. method:: getAnimeListInJSON(anime_name, limit = 100, offset = 0, fields = [])
Returns a JSON stringified containing the list of anime by name.
- Parameters:
- anime_name(str) - Name of the anime/series.
- limit(Optional[int]) - The maximum size of the list. The default value is 100.
- offset(Optional[int]) - The list offset. The default value is 0.
- fields(Optional[List [str]]) - List of fields used to show more information about the anime. If is empty, the default fields are id, title and main_picture.
- Raises:
- ValueError - The 'field' is not a valid field!
- Returns:
- List of animes in JSON format.
- Return type:
- str
Services that are used in the library.
Methods |
---|
:ref:`validateFields <validatefields>` |
.. method:: services.validateFields(fields)
Validate the fields provided.
Parameters: - fields(List [str]) - List of fields.
- Raises:
- ValueError - The 'field' is not a valid field!
- Returns:
- If the fields are valid or not.
- Return type:
- bool
Models are classes that are received from MyAnimeList and are not meant to be created by the user of the library.
!DANGER!
The classes listed below are not intended to be created by users and are also read-only.
For example, this means that you should not make your own :ref:`Anime <anime>` instances nor should you modify the :ref:`Anime <anime>` instance yourself.
Methods |
---|
:ref:`getSynonyms() <getSynonyms>` |
:ref:`getEnglish() <getEnglish>` |
:ref:`getJapanese() <getJapanese>` |
- Parameters:
.. method:: getSynonyms()
List of synonyms.
.. method:: getEnglish()
English version.
- Return type:
- str
.. method:: getJapanese()
Japanese version.
- Return type:
- str
- Parameters:
.. method:: getId() :noindex:
Anime ID.
- Return type:
- int
.. method:: getTitle() :noindex:
Anime title.
- Return type:
- str
.. method:: getMainPicture() :noindex:
Anime main picture.
- Return type:
- :ref:`Picture <picture>`
.. method:: getAlternativeTitle()
The alternative title of the anime.
- Return type:
- :ref:`AlternativeTitles <AlternativeTitles>`
.. method:: getStartDate()
The anime start date. Format
YYYY-mm-dd
.
- Return type:
- str
.. method:: getEndDate()
The anime end date. Format
YYYY-mm-dd
.
- Return type:
- str
.. method:: getSynopsis()
Anime synopsis.
- Return type:
- str
.. method:: getMean()
Mean score.
- Return type:
- float
.. method:: getRank()
Anime rank.
- Return type:
- int
.. method:: getPopularity()
Anime popularity.
- Return type:
- int
.. method:: getNumUserList()
The number of users who have the anime in their list.
- Return type:
- int
.. method:: getNumScoringUsers()
The number of users who rated the anime.
- Return type:
- int
.. method:: getNsfwClassification()
Anime NSFW classification.
- Return type:
- int
.. method:: getGenres()
The list of anime genres.
- Return type:
- List [:ref:`Genre <genre>`]
.. method:: getCreatedAt()
Timestamp of anime creation in MyAnimeList database.
- Return type:
- str
.. method:: getUpdatedAt()
Timestamp of anime update in MyAnimeList database.
- Return type:
- str
.. method:: getMediaType()
Anime media type.
- Return type:
- str
.. method:: getStatus()
Airing status.
- Return type:
- str
.. method:: getNumEpisodes()
The total number of episodes of this series. If unknown, it is 0.
- Return type:
- int
.. method:: getStartSeason()
Anime start season.
- Return type:
- :ref:`Season <Season>`
.. method:: getBroadcast()
Broadcast day of the week and start time (JST).
- Return type:
- :ref:`Broadcast <broadcast>` | None
.. method:: getSource()
Original work.
- Return type:
- str
.. method:: getAvgEpisodeDurationInSeconds()
Average length of episode in seconds.
- Return type:
- int
.. method:: getRating()
Anime rating.
- Return type:
- str
.. method:: getStudios()
List of studios that produced the anime.
- Return type:
- List [:ref:`Studio <studio>`]
.. method:: getPictures()
List of anime pictures.
Important
You cannot contain this field in a list.
- Return type:
- List [:ref:`Picture <picture>`] | None
.. method:: getBackground()
The API strips BBCode tags from the result.
Important
You cannot contain this field in a list.
.. method:: getRelatedAnimes()
List of related animes.
Important
You cannot contain this field in a list.
- Return type:
- List [:ref:`RelatedNode <relatedNode>`] | None
.. method:: getRelatedMangas()
List of related mangas.
Important
You cannot contain this field in a list.
- Return type:
- List [:ref:`RelatedNode <relatedNode>`] | None
.. method:: getRecommendations()
Summary of recommended anime for those who like this anime.
Important
You cannot contain this field in a list.
- Return type:
- List [:ref:`Recommendation <recommendation>`] | None
.. method:: getStatistics()
Anime statistics on MyAnimeList.
Important
You cannot contain this field in a list.
- Return type:
- List [:ref:`Statistics <statistics>`] | None
Methods |
---|
:ref:`getDayOfTheWeek() <getDayOfTheWeek>` |
:ref:`getStartTime() <getStartTime>` |
- Parameters:
- day_of_the_week (:ref:`DayWeekEnum <dayWeekEnum>`) - Day of the week broadcast in Japan time.
- start_time (str) - Time in hours format that is broadcasted.
.. method:: getDayOfTheWeek()
Broadcast day of the week.
- Return type:
- str
.. method:: getStartTime()
Anime start time in JST.
- Return type:
- str
Methods |
---|
:ref:`getId() <getIdGenre>` |
:ref:`getName() <getNameGenre>` |
.. method:: getId()
Genre ID.
- Return type:
- int
.. method:: getName()
Genre name.
- Return type:
- str
Methods |
---|
:ref:`getId() <getIdNode>` |
:ref:`getTitle() <getTitle>` |
:ref:`getMainPicture() <getMainPicture>` |
.. method:: getId() :noindex:
Anime or manga ID.
- Return type:
- int
.. method:: getTitle()
Anime or manga title.
- Return type:
- str
.. method:: getMainPicture()
Anime or manga main picture.
- Return type:
- :ref:`Picture <picture>`
Methods |
---|
:ref:`getLarge() <getLarge>` |
:ref:`getMedium() <getMedium>` |
- Parameters:
.. method:: getLarge()
Large size picture.
- Return type:
- str
.. method:: getMedium()
Medium size picture.
- Return type:
- str
Methods |
---|
:ref:`getId() <getIdRecommendation>` |
:ref:`getTitle() <getTitleRecommendation>` |
:ref:`getMainPicture() <getMainPictureRecommendation>` |
:ref:`getNumRecommendations() <getNumRecommendations>` |
- Parameters:
- id (int) - ID of the anime.
- title (str) - Title of the anime.
- main_picture (:ref:`Picture <picture>`) - Main picture of the anime.
- num_recommendations (int) - Number of recommendations of the anime.
.. method:: getId() :noindex:
Anime ID.
- Return type:
- int
.. method:: getTitle() :noindex:
Anime title.
- Return type:
- str
.. method:: getMainPicture() :noindex:
Anime main picture.
- Return type:
- :ref:`Picture <picture>`
.. method:: getNumRecommendations()
Number of recommendations.
- Return type:
- int
Methods |
---|
:ref:`getId() <getIdRelatedNode>` |
:ref:`getTitle() <getTitleRelatedNode>` |
:ref:`getMainPicture() <getMainPictureRelatedNode>` |
:ref:`getRelationType() <getRelationType>` |
- Parameters:
- id (int) - ID of the anime or manga.
- title (str) - Title of the anime or manga.
- main_picture (:ref:`Picture <picture>`) - Main picture of the anime or manga.
- relation_type (:ref:`RelationTypeEnum <RelationTypeEnum>`) - Relation type of the anime or manga.
.. method:: getId() :noindex:
Anime or manga ID.
- Return type:
- int
.. method:: getTitle() :noindex:
Anime or manga title.
- Return type:
- str
.. method:: getMainPicture() :noindex:
Anime or manga main picture.
- Return type:
- :ref:`Picture <picture>`
.. method:: getRelationType()
Anime or manga relation type.
- Return type:
- str
Methods |
---|
:ref:`getYear() <getYear>` |
:ref:`getSeason() <getSeason>` |
- Parameters:
- year (int) - Year of season.
- season (:ref:`SeasonEnum <SeasonEnum>`) - Season name.
.. method:: getYear()
Year of season.
- Return type:
- int
.. method:: getSeason()
Season name.
- Return type:
- str
Methods |
---|
:ref:`getNumUserLis() <getNumUserLis>` |
:ref:`getStatus() <getStatusStatistics>` |
- Parameters:
- num_list_users (int) - Number of users who added the anime to their list.
- status (:ref:`StatisticsStatus <StatisticsStatus>`) - Users list status.
.. method:: getNumUserLis()
The number of users who have the anime in their list.
- Return type:
- int
.. method:: getStatus() :noindex:
Anime status in the users list.
- Return type:
- :ref:`StatisticsStatus <StatisticsStatus>`
- Parameters:
.. method:: getNumWatching()
The number of users who are watching the anime.
- Return type:
- int
.. method:: getNumCompleted()
The number of users who are completed the anime.
- Return type:
- int
.. method:: getNumOnHold()
The number of users who are waiting for the anime.
- Return type:
- int
.. method:: getNumDropped()
The number of users who are dropped the anime.
- Return type:
- int
.. method:: getNumPlanToWatch()
The number of users who plan to watch the anime.
- Return type:
- int
Methods |
---|
:ref:`getId() <getIdStudio>` |
:ref:`getName() <getNameStudio>` |
.. method:: getId() :noindex:
Studio ID.
- Return type:
- int
.. method:: getName() :noindex:
Studio name.
- Return type:
- str
The library provides some enumerations to avoid the API from being stringly typed in case the strings change in the future.
All enumerations are subclasses of enum.Enum.
Warning
The enumerations listed below are not intended to be used by users and are also read-only.
.. c:enum:: enums.airingStatusEnum.AiringStatusEnum
Key | Value |
---|---|
finished_airing | Finished airing |
currently_airing | Currently airing |
not_yet_aired | Not yet aired |
.. c:enum:: enums.dayWeekEnum.DayWeekEnum
Key | Value |
---|---|
sunday | 0 |
monday | 1 |
tuesday | 2 |
wednesday | 3 |
thursday | 4 |
friday | 5 |
saturday | 6 |
.. c:enum:: enums.fieldsEnum.FieldsEnum
Key | Value | Key | Value |
---|---|---|---|
id | 0 | media_type | 16 |
title | 1 | status | 17 |
main_picture | 2 | num_episodes | 18 |
alternative_title | 3 | start_season | 19 |
start_date | 4 | broadcast | 20 |
end_date | 5 | source | 21 |
synopsis | 6 | average_episode_duration | 22 |
mean | 7 | rating | 23 |
rank | 8 | studios | 24 |
popularity | 9 | pictures | 25 |
num_list_users | 10 | background | 26 |
num_scoring_users | 11 | related_anime | 27 |
nsfw | 12 | related_manga | 28 |
genres | 13 | recommendations | 29 |
created_at | 14 | statistics | 30 |
updated_at | 15 |
Note
The keys pictures
, background
, related_anime
, related_manga
,
recommendations
, and statistics
cannot be in the fields parameter of
:ref:`getAnimeList() <getAnimeList>`, :ref:`getAnimeListInDict() <getAnimeListInDict>` and
:ref:`getAnimeListInJSON() <getAnimeListInJSON>` methods.
.. c:enum:: enums.mediaTypeEnum.MediaTypeEnum
Key | Value |
---|---|
unknown | 0 |
tv | 1 |
ova | 2 |
movie | 3 |
special | 4 |
ona | 5 |
music | 6 |
.. c:enum:: enums.nsfwEnum.NsfwEnum
Key | Value |
---|---|
white | This work is safe for work |
gray | This work may be not safe for work |
black | This work is not safe for work |
.. c:enum:: enums.ratingEnum.RatingEnum
Key | Value |
---|---|
g | All Age |
pg | Children |
pg_13 | Teens 13 and Older |
r | 17+ (violence & profanity) |
r_plus | Profanity & Mild Nudity |
rx | Hentai |
.. c:enum:: enums.relationTypeEnum.RelationTypeEnum
Key | Value |
---|---|
sequel | Sequel |
prequel | Prequel |
alternative_setting | Alternative Setting |
alternative_version | Alternative Version |
side_story | Side Story |
parent_story | Parent Story |
summary | Summary |
full_story | Full Story |
.. c:enum:: enums.seasonEnum.SeasonEnum
Key | Value |
---|---|
winter | Winter |
spring | Spring |
summer | Summer |
fall | Fall |
.. c:enum:: enums.sourceEnum.SourceEnum
Key | Value |
---|---|
other | Other |
original | Original |
manga | Manga |
four_koma_manga | 4 Koma manga |
web_manga | Web manga |
digital_manga | Digital manga |
novel | Novel |
light_novel | Light novel |
visual_novel | Visual novel |
game | Game |
card_game | Card game |
book | Book |
picture_book | Picture book |
radio | Radio |
music | Music |