AnimeTrace
Classes
AnimeTraceItem
Bases: BaseSearchItem
Represents a single AnimeTrace search result item.
This class processes and structures individual search results from AnimeTrace, providing easy access to various metadata about the found character.
Attributes:
Name | Type | Description |
---|---|---|
origin |
dict
|
The raw JSON data of the search result. |
box |
list[float]
|
Bounding box coordinates of the detected character [x1, y1, x2, y2]. |
box_id |
str
|
Unique identifier for the detected box. |
characters |
list[Character]
|
List of possible character matches with their source works. |
Source code in PicImageSearch/model/anime_trace.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
|
Functions
__init__(data, **kwargs)
Initializes an AnimeTraceItem with data from a search result.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
dict[str, Any]
|
A dictionary containing the search result data. |
required |
**kwargs
|
Any
|
Additional keyword arguments passed to the parent class. |
{}
|
Source code in PicImageSearch/model/anime_trace.py
35 36 37 38 39 40 41 42 |
|
AnimeTraceResponse
Bases: BaseSearchResponse[AnimeTraceItem]
Encapsulates a complete AnimeTrace API response.
This class processes and structures the full response from an AnimeTrace search, including all detected characters and their information.
Attributes:
Name | Type | Description |
---|---|---|
raw |
list[AnimeTraceItem]
|
List of processed search result items. |
origin |
dict[str, Any]
|
The raw JSON response data. |
code |
int
|
API response code (0 for success). |
ai |
bool
|
Whether the result was generated by AI. |
trace_id |
str
|
Unique identifier for the trace request. |
Source code in PicImageSearch/model/anime_trace.py
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
|
Functions
__init__(resp_data, resp_url, **kwargs)
Initializes with the response data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
resp_data
|
dict[str, Any]
|
A dictionary containing the parsed response data from AnimeTrace. |
required |
resp_url
|
str
|
URL to the search result page. |
required |
**kwargs
|
Any
|
Additional keyword arguments passed to the parent class. |
{}
|
Source code in PicImageSearch/model/anime_trace.py
78 79 80 81 82 83 84 85 86 |
|
Character
Bases: NamedTuple
Represents a character identified in AnimeTrace search results.
Contains information about the character's name and the work they appear in.
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
The name of the character. |
work |
str
|
The title of the work the character appears in. |
Source code in PicImageSearch/model/anime_trace.py
8 9 10 11 12 13 14 15 16 17 18 19 |
|