animedex.backends.anilist._mapper
AniList raw payload → typed dataclass mapping helpers.
Each map_* function takes a parsed JSON dict (the inner
data.<root> block from a GraphQL response) plus a
SourceTag and returns the matching
rich dataclass from animedex.backends.anilist.models.
When the upstream returned null for a single-id query (i.e.
data.Media is None), the mapper raises
ApiError with
reason="not-found" so the Python API surface presents a
consistent semantic.
map_media
map_media_list
map_character
map_character_list
map_staff
map_staff_list
map_studio
map_studio_list
map_user
map_user_list
map_genre_collection
map_media_tag_collection
map_site_statistics
map_external_link_source
map_airing_schedule
map_media_trend
map_review
map_recommendation
map_thread
map_thread_comment
map_activity
map_activity_reply
map_follow
map_media_list_public
map_viewer
- animedex.backends.anilist._mapper.map_viewer(payload: Dict[str, Any], src: SourceTag) AnilistUser[source]
Map
data.Viewer(authenticated) toAnilistUser.Same shape as
data.Userfrom the publicQ_USER_BY_NAMEquery, just keyed underViewer. We delegate tomap_user()after relabelling.