anime_list_apis.models.attributes package¶
Submodules¶
anime_list_apis.models.attributes.ConsumingStatus module¶
anime_list_apis.models.attributes.Date module¶
-
class
anime_list_apis.models.attributes.Date.
Date
(year: int, month: int, day: int)¶ Bases:
anime_list_apis.models.Serializable.Serializable
Class that models a date consisting of a year, a month and a day
-
__init__
(year: int, month: int, day: int)¶ Initializes the date object. Each parameter must be filled out. :param year: The year :param month: The month :param day: The day :raises TypeError: If any of the parameters is not an integer :raises ValueError: If any of the parameters takes on an invalid value
-
anime_list_apis.models.attributes.Id module¶
-
class
anime_list_apis.models.attributes.Id.
Id
(ids: Dict[anime_list_apis.models.attributes.Id.IdType, int])¶ Bases:
anime_list_apis.models.Serializable.Serializable
Class that models an ID. Has the capability to store different ID types
-
__init__
(ids: Dict[anime_list_apis.models.attributes.Id.IdType, int])¶ Initializes the ID. The IDs are set using a dictionary mapping IDs to the different ID types. At least one entry is required. Missing IDs will be replaced with None :param ids: The IDs mapped to an IdType :raises TypeError: If an invalid parameter type was provided :raises ValueError: In case no valid ID was provided
-
get
(id_type: anime_list_apis.models.attributes.Id.IdType) → Optional[int]¶ Retrieves an ID for a given ID type :param id_type: The ID type to get :return: The ID. If it does not exist, return None
-
set
(_id: int, id_type: anime_list_apis.models.attributes.Id.IdType)¶ Sets an ID for a given ID type :param _id: The ID to set :param id_type: The type of ID for which to set the ID :return: None :raises TypeError: If the provided ID is not an integer
-
anime_list_apis.models.attributes.MediaFormat module¶
-
class
anime_list_apis.models.attributes.MediaFormat.
MediaFormat
¶ Bases:
enum.Enum
Enumeration that models possible media formats
-
LIGHT_NOVEL
= 'NOVEL'¶
-
MANGA
= 'MANGA'¶
-
MOVIE
= 'MOVIE'¶
-
MUSIC
= 'MUSIC'¶
-
ONA
= 'ONA'¶
-
ONE_SHOT
= 'ONE_SHOT'¶
-
OVA
= 'OVA'¶
-
SPECIAL
= 'SPECIAL'¶
-
TV
= 'TV'¶
-
TV_SHORT
= 'TV_SHORT'¶
-
anime_list_apis.models.attributes.MediaType module¶
anime_list_apis.models.attributes.Relation module¶
-
class
anime_list_apis.models.attributes.Relation.
Relation
(source: anime_list_apis.models.attributes.Id.Id, source_type: anime_list_apis.models.attributes.MediaType.MediaType, dest: anime_list_apis.models.attributes.Id.Id, dest_type: anime_list_apis.models.attributes.MediaType.MediaType, relation_type: anime_list_apis.models.attributes.Relation.RelationType)¶ Bases:
anime_list_apis.models.Serializable.Serializable
Class that models a relation edge between two anime entries
-
__init__
(source: anime_list_apis.models.attributes.Id.Id, source_type: anime_list_apis.models.attributes.MediaType.MediaType, dest: anime_list_apis.models.attributes.Id.Id, dest_type: anime_list_apis.models.attributes.MediaType.MediaType, relation_type: anime_list_apis.models.attributes.Relation.RelationType)¶ Initializes the Relation object. :param source: The source node in the relation edge :param source_type: The media type of the source node :param dest: The destination node in the relation edge :param dest_type: The destination node’s media type :param relation_type: The type of the relation :raises TypeError: If invalid ID types are provided
or other types mismatch
- Raises
ValueError – If both IDs are the same, i.e. an invalid relation
-
is_important
() → bool¶ Checks if this relation is “important”, meaning if it’s a direct connection (Sequel, Prequel, Parent, Side Story or a summary) or not :return: True if the relation is important, False otherwise
-
-
class
anime_list_apis.models.attributes.Relation.
RelationType
¶ Bases:
enum.Enum
An enumeration modelling the different kinds of relations between entries.
-
ADAPTATION
= 203¶
-
ALTERNATIVE
= 204¶
-
CHARACTER
= 200¶
-
OTHER
= 202¶
-
PARENT
= 102¶
-
PREQUEL
= 100¶
-
SEQUEL
= 101¶
-
SIDE_STORY
= 103¶
-
SPIN_OFF
= 201¶
-
SUMMARY
= 104¶
-
anime_list_apis.models.attributes.ReleasingStatus module¶
anime_list_apis.models.attributes.Score module¶
-
class
anime_list_apis.models.attributes.Score.
Score
(score: int, score_type: anime_list_apis.models.attributes.Score.ScoreType)¶ Bases:
anime_list_apis.models.Serializable.Serializable
Class that models a score. Allows for different score types.
-
__init__
(score: int, score_type: anime_list_apis.models.attributes.Score.ScoreType)¶ Initializes the Score object. The score must be a positive number that less or equal than the maximum score of the score type. :param score: The points of the score :param score_type: The Type of score :raises TypeError: In case any of the parameter values
is of the wrong type
- Raises
ValueError – If the score is outside the valid range
-
convert
(score_type: anime_list_apis.models.attributes.Score.ScoreType)¶ Converts the internal score representation to another score type :param score_type: The score type to which to convert to :return: None
-
get
(score_type: anime_list_apis.models.attributes.Score.ScoreType = None) → int¶ Retrieves the score converted to the selected score type. If no score type was supplied, returns the default score type’s score :param score_type: The score type in which to retrieve the score.
If left as None, will result in the default score type to be used
- Returns
The score in the provided score type
-
-
class
anime_list_apis.models.attributes.Score.
ScoreType
¶ Bases:
enum.Enum
Enumeration modelling the different score types The value of the enum specifies the maximum value a score of that type may be. For example, TEN_POINT scores may range from 0 to 10
-
FIVE_POINT
= 5¶
-
PERCENTAGE
= 100¶
-
TEN_POINT
= 10¶
-
TEN_POINT_DECIMAL
= 20¶
-
THREE_POINT
= 3¶
-
anime_list_apis.models.attributes.Title module¶
-
class
anime_list_apis.models.attributes.Title.
Title
(titles: Dict[anime_list_apis.models.attributes.Title.TitleType, str], default: anime_list_apis.models.attributes.Title.TitleType = <TitleType.ROMAJI: 1>)¶ Bases:
anime_list_apis.models.Serializable.Serializable
Models a title of an entry
-
__init__
(titles: Dict[anime_list_apis.models.attributes.Title.TitleType, str], default: anime_list_apis.models.attributes.Title.TitleType = <TitleType.ROMAJI: 1>)¶ Initializes the Title object. In case no valid titles are supplied, a ValueError is raised :param titles: The titles to include :param default: The default title to show. Defaults to ROMAJI :raises TypeError: If an invalid parameter type was provided :raises ValueError: In case no valid titles were provided
-
change_default_title_type
(title_type: anime_list_apis.models.attributes.Title.TitleType)¶ Sets the default title type :param title_type: The new default title type :return: None :raises ValueError: If there exists no title entry for the provided
title type
-
get
(title_type: anime_list_apis.models.attributes.Title.TitleType = None) → Optional[str]¶ Retrieves the title in the provided title format :param title_type: The title type in which to retrieve the title.
Defaults to the current default title type
- Returns
The requested title string or None if no title string for the provided title exists
-
set
(title: str, title_type: anime_list_apis.models.attributes.Title.TitleType)¶ Sets the title of a title type :param title: The title string to set :param title_type: The type of that title :return: None :raises TypeError: If the type of the title string is wrong
-