animedex.backends.trace
High-level Trace.moe Python API.
Exposes screenshot search (URL or upload bytes) plus the quota probe.
The common-projection TraceQuota
returned by quota() drops the upstream’s caller-IP echo (the
/me id field) — callers who want it can use the rich
RawTraceQuota directly.
quota
- animedex.backends.trace.quota(*, config: Config | None = None, **kw) TraceQuota[source]
Fetch
/me: caller’s quota state.Returns the cross-source projection
TraceQuota, which omits the upstream’sidfield by design — the common shape is the lowest-common-denominator across backends and IP echoes don’t have a place there. A caller who wants the upstream payload as-is (includingid) can reach for the richRawTraceQuotadirectly: it round-trips the upstream verbatim.
search
- animedex.backends.trace.search(image_url: str | None = None, *, raw_bytes: bytes | None = None, anilist_info: bool = False, cut_borders: bool = False, anilist_id: int | None = None, config: Config | None = None, **kw) List[TraceHit][source]
Search
/search.- Parameters:
image_url – Public URL of the screenshot to identify. Mutually exclusive with
raw_bytes.raw_bytes – Raw image / video bytes to upload.
anilist_info – When
True, each hit carries an inlineAnimeTitlefrom AniList — saves a follow-up round-trip.cut_borders – When
True, trace.moe strips letterboxing before matching.anilist_id – When set, restrict matches to a specific show (useful when you already know the series).