animedex.models.manga
Manga domain models.
Mirrors the anime side. Manga is the cross-source common
projection (MangaDex provides the lion’s share of fields; AniList
also exposes manga but with thinner coverage). AtHomeServer
is included from day one because the future reader work reader path consumes
it; defining the shape now keeps the public model surface stable
through that release.
MangaStatus
MangaFormat
Chapter
- class animedex.models.manga.Chapter(*, id: str, number: str, title: str | None = None, language: str, pages: int | None = None, source: SourceTag)[source]
Bases:
AnimedexModelA manga chapter as returned by any single backend.
- Variables:
id (str) – Backend-native chapter identifier.
number (str) – Human-friendly number (kept as a string because numbering is non-monotonic and frequently fractional).
title (str or None) – Chapter title when set upstream.
language (str) – ISO 639 language code or upstream’s locale string.
pages (int or None) – Page count when known.
source (SourceTag) – Provenance tag.
Manga
- class animedex.models.manga.Manga(*, id: str, title: str, cover_url: str | None = None, chapters: List[Chapter] = [], languages: List[str] = [], description: str | None = None, status: Literal['ongoing', 'completed', 'hiatus', 'cancelled', 'unknown'] | None = None, format: Literal['MANGA', 'NOVEL', 'ONE_SHOT', 'DOUJINSHI', 'MANHWA', 'MANHUA'] | None = None, genres: List[str] = [], tags: List[str] = [], ids: Dict[str, str], source: SourceTag)[source]
Bases:
AnimedexModelA manga record.
- Variables:
id (str) – Canonical
"<source>:<id>"identifier.title (str) – Display title (single string; manga upstreams are less locale-rich than anime).
cover_url (str or None) – Public cover image URL.
chapters (list of Chapter) – Known chapters, in upstream order.
languages (list of str) – Languages with at least one translated chapter.
description (str or None) – Synopsis / description.
status (str or None) – Publication status, normalised to
MangaStatus.format (str or None) – Media format, normalised to
MangaFormat.source (SourceTag) – Provenance tag.
AtHomeServer
- class animedex.models.manga.AtHomeServer(*, base_url: str, chapter_hash: str, data: List[str], data_saver: List[str] = [], source: SourceTag)[source]
Bases:
AnimedexModelResult of MangaDex’s
GET /at-home/server/{chapter}call.The base URL is short-lived (~5 min). Per
plans/03we never cache it across chapters; the model carries it so a single invocation has a typed object to thread through the page-fetch loop.- Variables:
base_url (str) – Per-call base URL for the page bytes endpoint.
chapter_hash (str) – Hash that goes between the base URL and the per-page filenames.
data (list of str) – Filenames for full-resolution pages, in order.
data_saver (list of str) – Filenames for compressed-quality pages, in order. Empty when the upstream did not provide a saver-quality variant.
source (SourceTag) – Provenance tag.