animedex.backends.waifu
High-level Waifu.im Python API.
Three thin wrappers over the JSON read endpoints on
api.waifu.im: tags(), images(), artists().
NSFW posture mirrors the upstream: the /images endpoint defaults
to SFW only when isNsfw is omitted; pass is_nsfw=True from
Python (--is-nsfw true from the CLI) to opt in to NSFW results.
The flag is a transparent passthrough to the upstream’s isNsfw
query parameter, not a paternalistic confirmation gate.
artists
images
- animedex.backends.waifu.images(*, included_tags: List[str] | None = None, excluded_tags: List[str] | None = None, is_nsfw: bool | None = None, is_animated: bool | None = None, page_number: int | None = None, page_size: int | None = None, config: Config | None = None, **kw) List[WaifuImage][source]
List image records via
/imageswith optional filters.NSFW posture: when
is_nsfwisNone(the default), the parameter is omitted from the request and the upstream’s SFW-only default applies. Whenis_nsfw=True, NSFW images are returned. Whenis_nsfw=False, SFW images are returned explicitly. The flag is a transparent passthrough; the project’s posture is to inform the user about the upstream’s defaults, not to gate.- Parameters:
included_tags (list of str or None) – Tag slugs that must be present on returned images (multiple → all-of).
excluded_tags (list of str or None) – Tag slugs that must not be present.
is_nsfw (bool or None) – NSFW filter.
None(default) honours the upstream’s SFW-only default;True→ NSFW only;False→ SFW only (explicit).is_animated (bool or None) –
True→ only animated assets;False→ only static;None→ no filter.page_number (int or None) – 1-indexed page number.
page_size (int or None) – Rows per page.
- Returns:
List of typed images.
- Return type:
tag
tag_by_slug
artist
artist_by_name
- animedex.backends.waifu.artist_by_name(name: str, *, config: Config | None = None, **kw) WaifuArtist[source]
Fetch one artist by display name via
/artists/by-name/{name}.The response is the same artist envelope as
/artists/{id}but additionally includes the artist’simageslist.- Parameters:
name (str) – Artist display name (case-sensitive).
- Returns:
Typed artist (with extra
imagesfield viaextra='allow').- Return type:
image
stats_public
- animedex.backends.waifu.stats_public(*, config: Config | None = None, **kw) WaifuStats[source]
Fetch the public statistics envelope via
/stats/public.Returns a small object summarising the catalogue size + lifetime request volume; useful as a cheap upstream-liveness probe.
- Returns:
Typed statistics envelope.
- Return type: