Skip to content

Models

Media

Bases: ParentModel

Anime or Manga.

average_score class-attribute instance-attribute

average_score: int | None = None

A weighted average score of all the user's scores of the media

banner_image class-attribute instance-attribute

banner_image: HttpUrl | None = None

The banner image of the media

chapters class-attribute instance-attribute

chapters: int | None = None

The amount of chapters the manga has when complete

characters class-attribute instance-attribute

characters: tuple[Character, ...] = tuple()

The characters in the media

country_of_origin class-attribute instance-attribute

country_of_origin: CountryAlpha2 | None = None

Where the media was created. (ISO 3166-1 alpha-2)

cover_image class-attribute instance-attribute

The cover images of the media

description class-attribute instance-attribute

Short description of the media's story and characters

duration class-attribute instance-attribute

duration: int | None = None

The general length of each anime episode in minutes

end_date class-attribute instance-attribute

end_date: FuzzyDate = FuzzyDate()

The last official release date of the media

episodes class-attribute instance-attribute

episodes: int | None = None

The amount of episodes the anime has when complete

external_links: tuple[MediaExternalLink, ...] = tuple()

External links to another site related to the media

favourites class-attribute instance-attribute

favourites: int | None = None

The amount of user's who have favourited the media

format class-attribute instance-attribute

format: MediaFormat | None = None

The format the media was released in

genres class-attribute instance-attribute

genres: tuple[str, ...] = tuple()

The genres of the media

hashtag class-attribute instance-attribute

hashtag: str | None = None

Official Twitter hashtags for the media

id instance-attribute

id: int

The id of the media

id_mal class-attribute instance-attribute

id_mal: int | None = None

The mal id of the media

is_adult class-attribute instance-attribute

is_adult: bool | None = None

If the media is intended only for 18+ adult audiences

is_licensed class-attribute instance-attribute

is_licensed: bool | None = None

If the media is officially licensed or a self-published doujin release

is_locked class-attribute instance-attribute

is_locked: bool | None = None

Locked media may not be added to lists our favorited. This may be due to the entry pending for deletion or other reasons.

mean_score class-attribute instance-attribute

mean_score: int | None = None

Mean score of all the user's scores of the media

next_airing_episode class-attribute instance-attribute

next_airing_episode: AiringSchedule = AiringSchedule()

The media's next episode airing schedule

popularity class-attribute instance-attribute

popularity: int | None = None

The number of users with the media on their list

rankings class-attribute instance-attribute

rankings: tuple[MediaRank, ...] = tuple()

The ranking of the media in a particular time span and format compared to other media

relations class-attribute instance-attribute

relations: tuple[Relation, ...] = tuple()

Other media in the same or connecting franchise

season class-attribute instance-attribute

season: MediaSeason | None = None

The season the media was initially released in

season_int class-attribute instance-attribute

season_int: int | None = None

The year & season the media was initially released in

season_year class-attribute instance-attribute

season_year: int | None = None

The season year the media was initially released in

site_url instance-attribute

site_url: HttpUrl

The url for the media page on the AniList website

source class-attribute instance-attribute

source: MediaSource | None = None

Source type the media was adapted from.

staff class-attribute instance-attribute

staff: tuple[Staff, ...] = tuple()

Animation or production company

start_date class-attribute instance-attribute

start_date: FuzzyDate = FuzzyDate()

The first official release date of the media

status class-attribute instance-attribute

status: MediaStatus | None = None

The current releasing status of the media

streaming_episodes class-attribute instance-attribute

streaming_episodes: tuple[MediaStreamingEpisode, ...] = tuple()

Data and links to legal streaming episodes on external sites

studios class-attribute instance-attribute

studios: tuple[Studio, ...] = tuple()

Animation or production company

synonyms class-attribute instance-attribute

synonyms: tuple[str, ...] = tuple()

Alternative titles of the media

tags class-attribute instance-attribute

tags: tuple[MediaTag, ...] = tuple()

List of tags that describes elements and themes of the media

title class-attribute instance-attribute

The official titles of the media in various languages

trailer class-attribute instance-attribute

Media trailer or advertisement

trending class-attribute instance-attribute

trending: int | None = None

The amount of related activity in the past hour

type class-attribute instance-attribute

type: MediaType | None = None

The type of the media; anime or manga

updated_at class-attribute instance-attribute

updated_at: datetime = min

When the media's data was last updated

volumes class-attribute instance-attribute

volumes: int | None = None

The amount of volumes the manga has when complete

AiringSchedule

Bases: ParentModel

Media Airing Schedule.

airing_at class-attribute instance-attribute

airing_at: int | None = None

The time the episode airs at

episode class-attribute instance-attribute

episode: int | None = None

The airing episode number

id class-attribute instance-attribute

id: int | None = None

The id of the airing schedule item

media_id class-attribute instance-attribute

media_id: int | None = None

The associate media id of the airing episode

time_until_airing class-attribute instance-attribute

time_until_airing: int | None = None

Seconds until episode starts airing

Character

Bases: ParentModel

A character that features in an anime or manga

age class-attribute instance-attribute

age: str | None = None

The character's age. Note this is a string, not an int, it may contain further text and additional ages.

blood_type class-attribute instance-attribute

blood_type: str | None = None

The characters blood type

date_of_birth class-attribute instance-attribute

date_of_birth: FuzzyDate = FuzzyDate()

The character's birth date

description class-attribute instance-attribute

description: str | None = None

A general description of the character

favourites class-attribute instance-attribute

favourites: int | None = None

The amount of user's who have favourited the character

gender class-attribute instance-attribute

gender: str | None = None

The character's gender. Usually Male, Female, or Non-binary but can be any string.

id instance-attribute

id: int

The id of the character

image class-attribute instance-attribute

Character images

name class-attribute instance-attribute

The names of the character

role class-attribute instance-attribute

role: CharacterRole | None = None

The characters role in the media

site_url class-attribute instance-attribute

site_url: HttpUrl | None = None

The url for the character page on the AniList website

CharacterImage

Bases: ParentModel

Character's image

large class-attribute instance-attribute

large: HttpUrl | None = None

The character's image of media at its largest size

medium class-attribute instance-attribute

medium: HttpUrl | None = None

The character's image of media at medium size

CharacterName

Bases: ParentModel

The names of the character

alternative class-attribute instance-attribute

alternative: tuple[str, ...] = tuple()

Other names the character might be referred to as

alternative_spoiler class-attribute instance-attribute

alternative_spoiler: tuple[str, ...] = tuple()

Other names the character might be referred to as but are spoilers

first class-attribute instance-attribute

first: str | None = None

The character's given name

full class-attribute instance-attribute

full: str | None = None

The character's first and last name

last class-attribute instance-attribute

last: str | None = None

The character's surname

middle class-attribute instance-attribute

middle: str | None = None

The character's middle name

native class-attribute instance-attribute

native: str | None = None

The character's full name in their native language

FuzzyDate

Bases: ParentModel

Naive date object that allows for incomplete date values (fuzzy).

day class-attribute instance-attribute

day: int | None = None

Numeric Day (24)

month class-attribute instance-attribute

month: int | None = None

Numeric Month (3)

year class-attribute instance-attribute

year: int | None = None

Numeric Year (2017)

as_int

as_int() -> FuzzyDateInt

Return an 8 digit long date integer (YYYYMMDD). Unknown dates represented by 0. For example, 2016 is 20160000 and May 1976 is 19760500

The result is equivalent to AniList's FuzzyDateInt type.

Source code in src/pyanilist/_models.py
def as_int(self) -> FuzzyDateInt:
    """
    Return an 8 digit long date integer (YYYYMMDD).
    Unknown dates represented by 0.
    For example, 2016 is 20160000 and May 1976 is 19760500

    The result is equivalent to AniList's FuzzyDateInt type.
    """
    year = str(self.year).zfill(4) if self.year is not None else "1000"
    month = str(self.month).zfill(2) if self.month is not None else "00"
    day = str(self.day).zfill(2) if self.day is not None else "00"

    return int(f"{year}{month}{day}")

iso_format

iso_format() -> str

Returns the date formatted as an ISO 8601 string.

If year, month, and day are available, the format is "YYYY-MM-DD". If only year and month are available, the format is "YYYY-MM". If only year is available, the format is "YYYY". If no information is available, an empty string is returned.

Source code in src/pyanilist/_models.py
def iso_format(self) -> str:
    """
    Returns the date formatted as an ISO 8601 string.

    If year, month, and day are available, the format is "YYYY-MM-DD".
    If only year and month are available, the format is "YYYY-MM".
    If only year is available, the format is "YYYY".
    If no information is available, an empty string is returned.
    """
    if self.year and self.month and self.day:
        return f"{self.year}-{self.month:02}-{self.day:02}"

    elif self.year and self.month:
        return f"{self.year}-{self.month:02}"

    elif self.year:
        return f"{self.year}"

    else:
        return ""

MediaCoverImage

Bases: ParentModel

The cover images of the media.

color class-attribute instance-attribute

color: Color | None = None

Average #hex color of cover image

extra_large class-attribute instance-attribute

extra_large: HttpUrl | None = None

The cover image url of the media at its largest size. If this size isn't available, large will be provided instead.

large class-attribute instance-attribute

large: HttpUrl | None = None

The cover image url of the media at a large size

medium class-attribute instance-attribute

medium: HttpUrl | None = None

The cover image url of the media at medium size

MediaDescription

Bases: ParentModel

Description of the media

Note

The descriptions are processed with nh3 to sanitize them

default class-attribute instance-attribute

default: str | None = None

The default description of the media. This may or may not contain HTML tags

html class-attribute instance-attribute

html: str | None = None

The HTML formatted description of the media

markdown class-attribute instance-attribute

markdown: str | None = None

The Markdown formatted description of the media. This is derived from the html description with html2text

text class-attribute instance-attribute

text: str | None = None

The plain text formatted description of the media. This is derived from default description with a simple regex

Note

This will be "lossy" in the sense that things like like hrefs, italics, bolds, etc will also be stripped

Bases: ParentModel

An external link to another site related to the media or staff member.

icon class-attribute instance-attribute

icon: HttpUrl | None = None

The icon image url of the site. Not available for all links. Transparent PNG 64x64

id class-attribute instance-attribute

id: int | None = None

The id of the external link

language class-attribute instance-attribute

language: str | None = None

Language the site content is in. See Staff language field for values.

site class-attribute instance-attribute

site: str | None = None

The links website site name

site_id class-attribute instance-attribute

site_id: int | None = None

The links website site id

url class-attribute instance-attribute

url: HttpUrl | None = None

The url of the external link or base url of link source

MediaRank

Bases: ParentModel

The ranking of a media in a particular time span and format compared to other media

all_time class-attribute instance-attribute

all_time: bool | None = None

If the ranking is based on all time instead of a season/year

context class-attribute instance-attribute

context: str | None = None

String that gives context to the ranking type and time span

format class-attribute instance-attribute

format: MediaFormat | None = None

The format the media is ranked within

id class-attribute instance-attribute

id: int | None = None

The id of the rank

rank class-attribute instance-attribute

rank: int | None = None

The numerical rank of the media

season class-attribute instance-attribute

season: MediaSeason | None = None

The season the media is ranked within

type class-attribute instance-attribute

type: MediaRankType | None = None

The type of ranking

year class-attribute instance-attribute

year: int | None = None

The year the media is ranked within

MediaStreamingEpisode

Bases: ParentModel

Data and links to legal streaming episodes on external sites.

site class-attribute instance-attribute

site: str | None = None

The site location of the streaming episodes

thumbnail class-attribute instance-attribute

thumbnail: HttpUrl | None = None

Url of episode image thumbnail

title class-attribute instance-attribute

title: str | None = None

Title of the episode

url class-attribute instance-attribute

url: HttpUrl | None = None

The url of the episode

MediaTag

Bases: ParentModel

A tag that describes a theme or element of the media.

category class-attribute instance-attribute

category: str | None = None

The categories of tags this tag belongs to

description class-attribute instance-attribute

description: str | None = None

A general description of the tag

id class-attribute instance-attribute

id: int | None = None

The id of the tag

is_adult class-attribute instance-attribute

is_adult: bool | None = None

If the tag is only for adult 18+ media

is_general_spoiler class-attribute instance-attribute

is_general_spoiler: bool | None = None

If the tag could be a spoiler for any media

is_media_spoiler class-attribute instance-attribute

is_media_spoiler: bool | None = None

If the tag is a spoiler for this media

name class-attribute instance-attribute

name: str | None = None

The name of the tag

rank class-attribute instance-attribute

rank: int | None = None

The relevance ranking of the tag out of the 100 for this media

user_id class-attribute instance-attribute

user_id: int | None = None

The user who submitted the tag

MediaTitle

Bases: ParentModel

The official titles of the media in various languages.

english class-attribute instance-attribute

english: str | None = None

The official English title

native class-attribute instance-attribute

native: str | None = None

Official title in its native language

romaji class-attribute instance-attribute

romaji: str | None = None

The romanization of the native language title

MediaTrailer

Bases: ParentModel

Media trailer or advertisement.

id class-attribute instance-attribute

id: str | None = None

The trailer video id

site class-attribute instance-attribute

site: str | None = None

The site the video is hosted by (Currently either youtube or dailymotion)

thumbnail class-attribute instance-attribute

thumbnail: HttpUrl | None = None

The url for the thumbnail image of the video

Relation

Bases: ParentModel

Related Anime or Manga to parent Media

average_score class-attribute instance-attribute

average_score: int | None = None

A weighted average score of all the user's scores of the media

banner_image class-attribute instance-attribute

banner_image: HttpUrl | None = None

The banner image of the media

chapters class-attribute instance-attribute

chapters: int | None = None

The amount of chapters the manga has when complete

country_of_origin class-attribute instance-attribute

country_of_origin: CountryAlpha2 | None = None

Where the media was created. (ISO 3166-1 alpha-2)

cover_image class-attribute instance-attribute

The cover images of the media

description class-attribute instance-attribute

Short description of the media's story and characters

duration class-attribute instance-attribute

duration: int | None = None

The general length of each anime episode in minutes

end_date class-attribute instance-attribute

end_date: FuzzyDate = FuzzyDate()

The last official release date of the media

episodes class-attribute instance-attribute

episodes: int | None = None

The amount of episodes the anime has when complete

external_links: tuple[MediaExternalLink, ...] = tuple()

External links to another site related to the media

favourites class-attribute instance-attribute

favourites: int | None = None

The amount of user's who have favourited the media

format class-attribute instance-attribute

format: MediaFormat | None = None

The format the media was released in

genres class-attribute instance-attribute

genres: tuple[str, ...] = tuple()

The genres of the media

hashtag class-attribute instance-attribute

hashtag: str | None = None

Official Twitter hashtags for the media

id instance-attribute

id: int

The id of the media

id_mal class-attribute instance-attribute

id_mal: int | None = None

The mal id of the media

is_adult class-attribute instance-attribute

is_adult: bool | None = None

If the media is intended only for 18+ adult audiences

is_licensed class-attribute instance-attribute

is_licensed: bool | None = None

If the media is officially licensed or a self-published doujin release

is_locked class-attribute instance-attribute

is_locked: bool | None = None

Locked media may not be added to lists our favorited. This may be due to the entry pending for deletion or other reasons.

mean_score class-attribute instance-attribute

mean_score: int | None = None

Mean score of all the user's scores of the media

next_airing_episode class-attribute instance-attribute

next_airing_episode: AiringSchedule = AiringSchedule()

The media's next episode airing schedule

popularity class-attribute instance-attribute

popularity: int | None = None

The number of users with the media on their list

rankings class-attribute instance-attribute

rankings: tuple[MediaRank, ...] = tuple()

The ranking of the media in a particular time span and format compared to other media

relation_type class-attribute instance-attribute

relation_type: MediaRelation | None = None

The type of relation to the parent model

season class-attribute instance-attribute

season: MediaSeason | None = None

The season the media was initially released in

season_int class-attribute instance-attribute

season_int: int | None = None

The year & season the media was initially released in

season_year class-attribute instance-attribute

season_year: int | None = None

The season year the media was initially released in

site_url class-attribute instance-attribute

site_url: HttpUrl | None = None

The url for the media page on the AniList website

source class-attribute instance-attribute

source: MediaSource | None = None

Source type the media was adapted from.

start_date class-attribute instance-attribute

start_date: FuzzyDate = FuzzyDate()

The first official release date of the media

status class-attribute instance-attribute

status: MediaStatus | None = None

The current releasing status of the media

streaming_episodes class-attribute instance-attribute

streaming_episodes: tuple[MediaStreamingEpisode, ...] = tuple()

Data and links to legal streaming episodes on external sites

synonyms class-attribute instance-attribute

synonyms: tuple[str, ...] = tuple()

Alternative titles of the media

tags class-attribute instance-attribute

tags: tuple[MediaTag, ...] = tuple()

List of tags that describes elements and themes of the media

title class-attribute instance-attribute

The official titles of the media in various languages

trailer class-attribute instance-attribute

Media trailer or advertisement

trending class-attribute instance-attribute

trending: int | None = None

The amount of related activity in the past hour

type class-attribute instance-attribute

type: MediaType | None = None

The type of the media; anime or manga

updated_at class-attribute instance-attribute

updated_at: datetime = min

When the media's data was last updated

volumes class-attribute instance-attribute

volumes: int | None = None

The amount of volumes the manga has when complete

Staff

Bases: ParentModel

Voice actors or production staff

age class-attribute instance-attribute

age: int | None = None

The person's age in years

blood_type class-attribute instance-attribute

blood_type: str | None = None

The persons blood type

date_of_birth class-attribute instance-attribute

date_of_birth: FuzzyDate = FuzzyDate()

The staff's date of birth.

date_of_death class-attribute instance-attribute

date_of_death: FuzzyDate = FuzzyDate()

The staff's date of death.

description class-attribute instance-attribute

description: str | None = None

A general description of the staff member

gender class-attribute instance-attribute

gender: str | None = None

The staff's gender. Usually Male, Female, or Non-binary but can be any string.

home_town class-attribute instance-attribute

home_town: str | None = None

The persons birthplace or hometown

id class-attribute instance-attribute

id: int | None = None

The id of the staff member

image class-attribute instance-attribute

The staff images

language_v2 class-attribute instance-attribute

language_v2: str | None = None

The primary language of the staff member. Current values: Japanese, English, Korean, Italian, Spanish, Portuguese, French, German, Hebrew, Hungarian, Chinese, Arabic, Filipino, Catalan, Finnish, Turkish, Dutch, Swedish, Thai, Tagalog, Malaysian, Indonesian, Vietnamese, Nepali, Hindi, Urdu

name class-attribute instance-attribute

name: StaffName = StaffName()

The names of the staff member

primary_occupations class-attribute instance-attribute

primary_occupations: tuple[str, ...] = tuple()

The person's primary occupations

role class-attribute instance-attribute

role: str | None = None

The role of the staff member in the production of the media

site_url class-attribute instance-attribute

site_url: HttpUrl | None = None

The url for the staff page on the AniList website

years_active class-attribute instance-attribute

years_active: YearsActive = YearsActive()

(start_year, end_year) (If the 2nd value is not present staff is still active)

StaffImage

Bases: ParentModel

Staff's image

large class-attribute instance-attribute

large: HttpUrl | None = None

The person's image of media at its largest size

medium class-attribute instance-attribute

medium: HttpUrl | None = None

The person's image of media at medium size

StaffName

Bases: ParentModel

The names of the staff member

alternative class-attribute instance-attribute

alternative: tuple[str, ...] = tuple()

Other names the staff member might be referred to as (pen names)

first class-attribute instance-attribute

first: str | None = None

The person's given name

full class-attribute instance-attribute

full: str | None = None

The person's first and last name

last class-attribute instance-attribute

last: str | None = None

The person's surname

middle class-attribute instance-attribute

middle: str | None = None

The person's middle name

native class-attribute instance-attribute

native: str | None = None

The person's full name in their native language

Studio

Bases: ParentModel

Animation or production company

favourites class-attribute instance-attribute

favourites: int | None = None

The amount of user's who have favourited the studio

id class-attribute instance-attribute

id: int | None = None

The id of the studio

is_animation_studio class-attribute instance-attribute

is_animation_studio: bool | None = None

If the studio is an animation studio or a different kind of company

is_main class-attribute instance-attribute

is_main: bool | None = None

If the studio is the main animation studio of the anime

name class-attribute instance-attribute

name: str | None = None

The name of the studio

site_url class-attribute instance-attribute

site_url: HttpUrl | None = None

The url for the studio page on the AniList website