animedex.backends.nekos

High-level nekos.best v2 Python API.

Three thin wrappers over the v2 endpoints:

  • categories() — list every available category name (sugar over GET /endpoints).

  • image() — fetch one or more random images / GIFs from a named category.

  • search() — best-effort metadata search across all categories.

Every function accepts config and forwards transport-level keyword arguments to the underlying passthrough call.

categories

animedex.backends.nekos.categories(*, config: Config | None = None, **kw) List[str][source]

List every nekos.best v2 category name.

Calls GET /endpoints and returns just the category names, alphabetically. The richer per-category format data is available via categories_full() for callers that want the asset format and filename range.

Returns:

Alphabetised list of category names.

Return type:

list[str]

categories_full

animedex.backends.nekos.categories_full(*, config: Config | None = None, **kw) Dict[str, NekosCategoryFormat][source]

List every category along with its per-category format metadata.

Calls GET /endpoints and validates each entry through NekosCategoryFormat so downstream callers get typed access to format / min / max.

Returns:

Mapping from category name to format metadata.

Return type:

dict[str, NekosCategoryFormat]

image

animedex.backends.nekos.image(category: str, *, amount: int = 1, config: Config | None = None, **kw) List[NekosImage][source]

Fetch one or more random images / GIFs from a category.

Calls GET /<category>?amount=<N>. The upstream’s response body is {"results": [<NekosImage>, ...]}; each row is validated through NekosImage.

Parameters:
  • category (str) – Category name (e.g. "husbando", "neko", "waifu"). Must be one of those returned by categories().

  • amount (int) – Number of images to return, 1..20. Defaults to 1.

Returns:

List of images. The list is always at least one entry long when the category is valid.

Return type:

list[NekosImage]

Raises:

ApiErrorbad-args for amount out of range, not-found when the category is unknown.

selftest

animedex.backends.nekos.selftest() bool[source]

Smoke-test the public nekos.best Python API (signatures only).

Confirms each public callable accepts a config keyword so the Click factory’s keyword-injection pattern works, and that the callables list matches the documented surface.

Returns:

True on success.

Return type:

bool