Lenso
Classes
LensoResponse
Bases: BaseSearchResponse[LensoResultItem]
Encapsulates a complete Lenso search response.
Attributes:
Name | Type | Description |
---|---|---|
origin |
dict
|
The raw JSON response data from Lenso. |
raw |
list[LensoResultItem]
|
List of all search results. |
url |
str
|
URL of the search results page. |
similar |
list[LensoResultItem]
|
Similar image results. |
duplicates |
list[LensoResultItem]
|
Duplicate image results. |
places |
list[LensoResultItem]
|
Place recognition results. |
related |
list[LensoResultItem]
|
Related image results. |
people |
list[LensoResultItem]
|
People recognition results. |
detected_faces |
list[Any]
|
Detected faces in the image. |
Source code in PicImageSearch/model/lenso.py
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 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
|
Attributes
detected_faces = []
instance-attribute
duplicates = []
instance-attribute
people = []
instance-attribute
places = []
instance-attribute
raw = []
instance-attribute
related = []
instance-attribute
similar = []
instance-attribute
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 Lenso's API. |
required |
resp_url
|
str
|
URL of the search results page. |
required |
**kwargs
|
Any
|
Additional keyword arguments. |
{}
|
Source code in PicImageSearch/model/lenso.py
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
|
_parse_response(resp_data, **kwargs)
Parse the raw response data into structured results.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
resp_data
|
dict[str, Any]
|
Raw response dictionary from Lenso's API. |
required |
**kwargs
|
Any
|
Additional keyword arguments (unused). |
{}
|
Source code in PicImageSearch/model/lenso.py
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
|
LensoResultItem
Bases: BaseSearchItem
Represents a single Lenso search result item.
Attributes:
Name | Type | Description |
---|---|---|
origin |
dict
|
The raw JSON data of the search result item. |
title |
str
|
Title or name of the search result. |
url |
str
|
URL of the webpage containing the image. |
hash |
str
|
The hash of the image. |
similarity |
float
|
The similarity score (0-100). |
thumbnail |
str
|
URL of the thumbnail version of the image. |
url_list |
list[LensoURLItem]
|
List of related URLs. |
width |
int
|
The width of the image. |
height |
int
|
The height of the image. |
Source code in PicImageSearch/model/lenso.py
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 62 |
|
Attributes
height = 0
instance-attribute
url_list = []
instance-attribute
width = 0
instance-attribute
Functions
__init__(data, **kwargs)
Source code in PicImageSearch/model/lenso.py
43 44 45 46 47 |
|
_parse_data(data, **kwargs)
Parse search result data.
Source code in PicImageSearch/model/lenso.py
49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
|
LensoURLItem
Represents a URL item in Lenso search results.
A class that processes and stores URL-related information from a Lenso search result.
Attributes:
Name | Type | Description |
---|---|---|
origin |
dict
|
The raw JSON data of the URL item. |
image_url |
str
|
Direct URL to the full-size image. |
source_url |
str
|
URL of the webpage containing the image. |
title |
str
|
Title or description of the image. |
lang |
str
|
Language of the webpage. |
Source code in PicImageSearch/model/lenso.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
|
Attributes
image_url = data.get('imageUrl', '')
instance-attribute
lang = data.get('lang', '')
instance-attribute
origin = data
instance-attribute
source_url = data.get('sourceUrl', '')
instance-attribute
title = data.get('title') or ''
instance-attribute
Functions
__init__(data)
Source code in PicImageSearch/model/lenso.py
20 21 22 23 24 25 |
|