otaku_info_web.utils package

Submodules

otaku_info_web.utils.db_model_helper module

otaku_info_web.utils.db_model_helper.build_service_url(media_type: otaku_info_web.utils.enums.MediaType, service: otaku_info_web.utils.enums.ListService, service_id: str) → str

Builds an URL for an external service based on an ID :param media_type: The media type for which to generate an URL :param service: The service for which to create the URL :param service_id: The ID of the media item on that service :return: The generated URL

otaku_info_web.utils.db_model_helper.build_title(english_title: Optional[str], romaji_title: str) → str

Determines the title based on an English and Romaji title :param english_title: The english title :param romaji_title: The romaji title :return: The title

otaku_info_web.utils.enums module

class otaku_info_web.utils.enums.ConsumingState

Bases: enum.Enum

Class that defines the possible consuming states for a user and media item

COMPLETED = 'completed'
CURRENT = 'current'
DROPPED = 'dropped'
PAUSED = 'paused'
PLANNING = 'planning'
REPEATING = 'repeating'
class otaku_info_web.utils.enums.ListService

Bases: enum.Enum

Class that defines available list services

ANILIST = 'anilist'
ANIMEPLANET = 'animeplanet'
KITSU = 'kitsu'
MANGADEX = 'mangadex'
MANGAUPDATES = 'mangaupdates'
MYANIMELIST = 'myanimelist'
class otaku_info_web.utils.enums.MediaRelationType

Bases: enum.Enum

Class that models a media relation type

ADAPTATION = 'adaptation'
ALTERNATIVE = 'alternative'
CHARACTER = 'character'
COMPILATION = 'compilation'
CONTAINS = 'contains'
OTHER = 'other'
PARENT = 'parent'
PREQUEL = 'prequel'
SEQUEL = 'sequel'
SIDE_STORY = 'side_story'
SOURCE = 'source'
SPIN_OFF = 'spin_off'
SUMMARY = 'summary'
class otaku_info_web.utils.enums.MediaSubType

Bases: enum.Enum

Class that models a media subtype for media items

MANGA = 'manga'
MOVIE = 'movie'
MUSIC = 'music'
NOVEL = 'novel'
ONA = 'ona'
ONE_SHOT = 'one_shot'
OVA = 'ova'
SPECIAL = 'special'
TV = 'tv'
TV_SHORT = 'tv_short'
UNKNOWN = 'unknown'
class otaku_info_web.utils.enums.MediaType

Bases: enum.Enum

Class that models a media type for media items

ANIME = 'anime'
MANGA = 'manga'
class otaku_info_web.utils.enums.NotificationType

Bases: enum.Enum

Class that defines the possible notification types

NEW_ANIME_EPISODES = 'new_anime_episodes'
NEW_MANGA_CHAPTERS = 'new_manga_chapters'
class otaku_info_web.utils.enums.ReleasingState

Bases: enum.Enum

Class that defines possible releasing states

CANCELLED = 'cancelled'
FINISHED = 'finished'
NOT_YET_RELEASED = 'not_yet_released'
RELEASING = 'releasing'
UNKNOWN = 'unknown'

otaku_info_web.utils.mappings module

otaku_info_web.utils.mappings.list_service_id_types: Dict[otaku_info_web.utils.enums.ListService, Type] = {<ListService.ANILIST: 'anilist'>: <class 'int'>, <ListService.ANIMEPLANET: 'animeplanet'>: <class 'str'>, <ListService.KITSU: 'kitsu'>: <class 'int'>, <ListService.MANGAUPDATES: 'mangaupdates'>: <class 'int'>, <ListService.MYANIMELIST: 'myanimelist'>: <class 'int'>, <ListService.MANGADEX: 'mangadex'>: <class 'int'>}

Which type a list service ID should have

otaku_info_web.utils.mappings.list_service_url_formats: Dict[otaku_info_web.utils.enums.ListService, str] = {<ListService.ANILIST: 'anilist'>: 'https://anilist.co/@{media_type}/@{id}', <ListService.ANIMEPLANET: 'animeplanet'>: 'https://www.anime-planet.com/@{media_type}/@{id}', <ListService.KITSU: 'kitsu'>: 'https://kitsu.io/anime/@{id}', <ListService.MANGAUPDATES: 'mangaupdates'>: 'https://www.mangaupdates.com/series.html?id=@{id}', <ListService.MYANIMELIST: 'myanimelist'>: 'https://myanimelist.net/@{media_type}/@{id}', <ListService.MANGADEX: 'mangadex'>: 'https://mangadex.org/title/@{id}'}

Schemas for URLs for external services

otaku_info_web.utils.mappings.mangadex_external_id_names: Dict[otaku_info_web.utils.enums.ListService, str] = {<ListService.ANILIST: 'anilist'>: 'al', <ListService.ANIMEPLANET: 'animeplanet'>: 'ap', <ListService.KITSU: 'kitsu'>: 'kt', <ListService.MANGAUPDATES: 'mangaupdates'>: 'mu', <ListService.MYANIMELIST: 'myanimelist'>: 'mal', <ListService.MANGADEX: 'mangadex'>: 'NONE'}

The names used by mangadex to identify IDs from other services

Module contents