channel3-sdk 0.2.1__py3-none-any.whl → 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of channel3-sdk might be problematic. Click here for more details.
- channel3_sdk/__init__.py +23 -17
- channel3_sdk/_gen/.gitignore +23 -0
- channel3_sdk/_gen/README.md +124 -0
- channel3_sdk/_gen/fast_api_client/__init__.py +8 -0
- channel3_sdk/_gen/fast_api_client/api/__init__.py +1 -0
- channel3_sdk/_gen/fast_api_client/api/channel3_api/__init__.py +1 -0
- channel3_sdk/_gen/fast_api_client/api/channel3_api/get_brand_detail_v0_brands_brand_id_get.py +179 -0
- channel3_sdk/_gen/fast_api_client/api/channel3_api/get_brands_v0_brands_get.py +218 -0
- channel3_sdk/_gen/fast_api_client/api/channel3_api/get_product_detail_v0_products_product_id_get.py +179 -0
- channel3_sdk/_gen/fast_api_client/api/channel3_api/search_v0_search_post.py +193 -0
- channel3_sdk/_gen/fast_api_client/api/default/__init__.py +1 -0
- channel3_sdk/_gen/fast_api_client/api/default/root_get.py +79 -0
- channel3_sdk/_gen/fast_api_client/client.py +268 -0
- channel3_sdk/_gen/fast_api_client/errors.py +16 -0
- channel3_sdk/_gen/fast_api_client/models/__init__.py +35 -0
- channel3_sdk/_gen/fast_api_client/models/availability_status.py +15 -0
- channel3_sdk/_gen/fast_api_client/models/brand.py +109 -0
- channel3_sdk/_gen/fast_api_client/models/error_response.py +59 -0
- channel3_sdk/_gen/fast_api_client/models/paginated_response_brand.py +83 -0
- channel3_sdk/_gen/fast_api_client/models/pagination_meta.py +84 -0
- channel3_sdk/_gen/fast_api_client/models/price.py +89 -0
- channel3_sdk/_gen/fast_api_client/models/product.py +166 -0
- channel3_sdk/_gen/fast_api_client/models/product_detail.py +306 -0
- channel3_sdk/_gen/fast_api_client/models/product_detail_gender_type_0.py +10 -0
- channel3_sdk/_gen/fast_api_client/models/search_config.py +69 -0
- channel3_sdk/_gen/fast_api_client/models/search_filter_price.py +92 -0
- channel3_sdk/_gen/fast_api_client/models/search_filters.py +191 -0
- channel3_sdk/_gen/fast_api_client/models/search_filters_gender_type_0.py +10 -0
- channel3_sdk/_gen/fast_api_client/models/search_request.py +191 -0
- channel3_sdk/_gen/fast_api_client/models/variant.py +75 -0
- channel3_sdk/_gen/fast_api_client/py.typed +1 -0
- channel3_sdk/_gen/fast_api_client/types.py +54 -0
- channel3_sdk/_gen/pyproject.toml +26 -0
- channel3_sdk/client.py +266 -479
- {channel3_sdk-0.2.1.dist-info → channel3_sdk-1.0.0.dist-info}/METADATA +83 -26
- channel3_sdk-1.0.0.dist-info/RECORD +38 -0
- {channel3_sdk-0.2.1.dist-info → channel3_sdk-1.0.0.dist-info}/WHEEL +1 -1
- channel3_sdk/models.py +0 -135
- channel3_sdk-0.2.1.dist-info/RECORD +0 -7
|
@@ -1,25 +1,29 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: channel3-sdk
|
|
3
|
-
Version: 0.
|
|
4
|
-
Summary: The official Python SDK for Channel3
|
|
5
|
-
Home-page: https://github.com/channel3/sdk-python
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: The official Python SDK for Channel3
|
|
5
|
+
Home-page: https://github.com/channel3-ai/sdk-python
|
|
6
6
|
License: MIT
|
|
7
7
|
Keywords: ai,shopping,ecommerce,search,api
|
|
8
8
|
Author: Channel3
|
|
9
9
|
Author-email: alex@trychannel3.com
|
|
10
|
-
Requires-Python: >=3.
|
|
10
|
+
Requires-Python: >=3.9,<4.0
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
11
13
|
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python
|
|
12
15
|
Classifier: Programming Language :: Python :: 3
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
14
16
|
Classifier: Programming Language :: Python :: 3.9
|
|
15
17
|
Classifier: Programming Language :: Python :: 3.10
|
|
16
18
|
Classifier: Programming Language :: Python :: 3.11
|
|
17
19
|
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
-
Classifier:
|
|
19
|
-
|
|
20
|
-
Requires-Dist:
|
|
20
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
21
|
+
Classifier: Typing :: Typed
|
|
22
|
+
Requires-Dist: attrs (>=22.2.0)
|
|
23
|
+
Requires-Dist: httpx (>=0.23.0,<0.29.0)
|
|
24
|
+
Requires-Dist: python-dateutil (>=2.8.0,<3.0.0)
|
|
21
25
|
Requires-Dist: requests (>=2.31.0,<3.0.0)
|
|
22
|
-
Project-URL: Repository, https://github.com/channel3/sdk-python
|
|
26
|
+
Project-URL: Repository, https://github.com/channel3-ai/sdk-python
|
|
23
27
|
Description-Content-Type: text/markdown
|
|
24
28
|
|
|
25
29
|
# Channel3 Python SDK
|
|
@@ -63,10 +67,7 @@ if product_detail.key_features:
|
|
|
63
67
|
|
|
64
68
|
# Get all brands
|
|
65
69
|
brands = client.get_brands()
|
|
66
|
-
|
|
67
|
-
print(f"Brand: {brand.name}")
|
|
68
|
-
if brand.description:
|
|
69
|
-
print(f"Description: {brand.description}")
|
|
70
|
+
print(f"Found {len(brands.items)} brands")
|
|
70
71
|
|
|
71
72
|
# Get specific brand details
|
|
72
73
|
brand = client.get_brand("brand_123")
|
|
@@ -82,23 +83,23 @@ from channel3_sdk import AsyncChannel3Client
|
|
|
82
83
|
async def main():
|
|
83
84
|
# Initialize the async client
|
|
84
85
|
client = AsyncChannel3Client(api_key="your_api_key_here")
|
|
85
|
-
|
|
86
|
+
|
|
86
87
|
# Search for products
|
|
87
88
|
products = await client.search(query="running shoes")
|
|
88
|
-
|
|
89
|
+
|
|
89
90
|
for product in products:
|
|
90
91
|
print(f"Product: {product.title}")
|
|
91
92
|
print(f"Score: {product.score}")
|
|
92
93
|
print(f"Price: {product.price.currency} {product.price.price}")
|
|
93
|
-
|
|
94
|
+
|
|
94
95
|
# Get detailed product information
|
|
95
96
|
if products:
|
|
96
97
|
product_detail = await client.get_product(products[0].id)
|
|
97
98
|
print(f"Availability: {product_detail.availability}")
|
|
98
|
-
|
|
99
|
+
|
|
99
100
|
# Get brands
|
|
100
101
|
brands = await client.get_brands()
|
|
101
|
-
print(f"Found {len(brands)} brands")
|
|
102
|
+
print(f"Found {len(brands.items)} brands")
|
|
102
103
|
|
|
103
104
|
# Run the async function
|
|
104
105
|
asyncio.run(main())
|
|
@@ -150,11 +151,39 @@ products = client.search(
|
|
|
150
151
|
)
|
|
151
152
|
```
|
|
152
153
|
|
|
154
|
+
### Search configuration and context
|
|
155
|
+
|
|
156
|
+
You can control how search behaves using `SearchConfig`, and add optional `context` to guide results.
|
|
157
|
+
|
|
158
|
+
```python
|
|
159
|
+
from channel3_sdk import SearchConfig
|
|
160
|
+
|
|
161
|
+
config = SearchConfig(enrich_query=True, semantic_search=False)
|
|
162
|
+
|
|
163
|
+
products = client.search(
|
|
164
|
+
query="running shoes",
|
|
165
|
+
limit=5,
|
|
166
|
+
config=config, # or a dict: {"enrich_query": True, "semantic_search": False}
|
|
167
|
+
context="Marathon training on road surfaces"
|
|
168
|
+
)
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
Async usage is identical:
|
|
172
|
+
|
|
173
|
+
```python
|
|
174
|
+
products = await async_client.search(
|
|
175
|
+
query="hiking boots",
|
|
176
|
+
config={"enrich_query": False, "semantic_search": True},
|
|
177
|
+
context="Waterproof boots for alpine conditions"
|
|
178
|
+
)
|
|
179
|
+
```
|
|
180
|
+
|
|
153
181
|
### Brand Management
|
|
154
182
|
|
|
155
183
|
```python
|
|
156
184
|
# Get all brands with pagination
|
|
157
185
|
brands = client.get_brands(page=1, size=50)
|
|
186
|
+
print(brands.pagination.total_count)
|
|
158
187
|
|
|
159
188
|
# Search for specific brands
|
|
160
189
|
nike_brands = client.get_brands(query="nike")
|
|
@@ -170,26 +199,31 @@ print(f"Logo: {brand_detail.logo_url}")
|
|
|
170
199
|
### Client Classes
|
|
171
200
|
|
|
172
201
|
#### `Channel3Client`
|
|
202
|
+
|
|
173
203
|
Synchronous client for the Channel3 API.
|
|
174
204
|
|
|
175
205
|
**Methods:**
|
|
176
|
-
|
|
206
|
+
|
|
207
|
+
- `search(query=None, image_url=None, base64_image=None, filters=None, limit=20, config=None, context=None)` → `List[Product]`
|
|
177
208
|
- `get_product(product_id)` → `ProductDetail`
|
|
178
|
-
- `get_brands(query=None, page=1, size=100)` → `
|
|
209
|
+
- `get_brands(query=None, page=1, size=100)` → `PaginatedResponseBrand`
|
|
179
210
|
- `get_brand(brand_id)` → `Brand`
|
|
180
211
|
|
|
181
|
-
#### `AsyncChannel3Client`
|
|
212
|
+
#### `AsyncChannel3Client`
|
|
213
|
+
|
|
182
214
|
Asynchronous client for the Channel3 API.
|
|
183
215
|
|
|
184
216
|
**Methods:**
|
|
185
|
-
|
|
217
|
+
|
|
218
|
+
- `async search(query=None, image_url=None, base64_image=None, filters=None, limit=20, config=None, context=None)` → `List[Product]`
|
|
186
219
|
- `async get_product(product_id)` → `ProductDetail`
|
|
187
|
-
- `async get_brands(query=None, page=1, size=100)` → `
|
|
220
|
+
- `async get_brands(query=None, page=1, size=100)` → `PaginatedResponseBrand`
|
|
188
221
|
- `async get_brand(brand_id)` → `Brand`
|
|
189
222
|
|
|
190
223
|
### Models
|
|
191
224
|
|
|
192
225
|
#### `Product`
|
|
226
|
+
|
|
193
227
|
- `id: str` - Unique product identifier
|
|
194
228
|
- `score: float` - Search relevance score
|
|
195
229
|
- `title: str` - Product title
|
|
@@ -201,6 +235,7 @@ Asynchronous client for the Channel3 API.
|
|
|
201
235
|
- `variants: List[Variant]` - Product variants
|
|
202
236
|
|
|
203
237
|
#### `ProductDetail`
|
|
238
|
+
|
|
204
239
|
- `title: str` - Product title
|
|
205
240
|
- `description: Optional[str]` - Product description
|
|
206
241
|
- `brand_id: Optional[str]` - Brand identifier
|
|
@@ -212,34 +247,57 @@ Asynchronous client for the Channel3 API.
|
|
|
212
247
|
- `variants: List[Variant]` - Product variants
|
|
213
248
|
|
|
214
249
|
#### `Brand`
|
|
250
|
+
|
|
215
251
|
- `id: str` - Unique brand identifier
|
|
216
252
|
- `name: str` - Brand name
|
|
217
253
|
- `logo_url: Optional[str]` - Brand logo URL
|
|
218
254
|
- `description: Optional[str]` - Brand description
|
|
219
255
|
|
|
220
256
|
#### `Variant`
|
|
257
|
+
|
|
221
258
|
- `product_id: str` - Associated product identifier
|
|
222
259
|
- `title: str` - Variant title
|
|
223
260
|
- `image_url: str` - Variant image URL
|
|
224
261
|
|
|
225
262
|
#### `SearchFilters`
|
|
263
|
+
|
|
226
264
|
- `brand_ids: Optional[List[str]]` - Brand ID filters
|
|
227
265
|
- `gender: Optional[Literal["male", "female", "unisex"]]` - Gender filter
|
|
228
266
|
- `price: Optional[SearchFilterPrice]` - Price range filter
|
|
229
267
|
- `availability: Optional[List[AvailabilityStatus]]` - Availability filters
|
|
230
268
|
|
|
231
269
|
#### `SearchFilterPrice`
|
|
270
|
+
|
|
232
271
|
- `min_price: Optional[float]` - Minimum price
|
|
233
272
|
- `max_price: Optional[float]` - Maximum price
|
|
234
273
|
|
|
274
|
+
#### `SearchConfig`
|
|
275
|
+
|
|
276
|
+
- `enrich_query: bool = True` — enable query rewriting/enrichment
|
|
277
|
+
- `semantic_search: bool = True` — enable semantic ranking
|
|
278
|
+
|
|
235
279
|
#### `Price`
|
|
280
|
+
|
|
236
281
|
- `price: float` - Current price
|
|
237
282
|
- `compare_at_price: Optional[float]` - Original price (if discounted)
|
|
238
283
|
- `currency: str` - Currency code
|
|
239
284
|
|
|
240
285
|
#### `AvailabilityStatus`
|
|
286
|
+
|
|
241
287
|
Enum with values: `IN_STOCK`, `OUT_OF_STOCK`, `PRE_ORDER`, `LIMITED_AVAILABILITY`, `BACK_ORDER`, `DISCONTINUED`, `SOLD_OUT`, `UNKNOWN`
|
|
242
288
|
|
|
289
|
+
#### `PaginatedResponseBrand`
|
|
290
|
+
|
|
291
|
+
- `items: List[Brand]` — page of brands
|
|
292
|
+
- `pagination: PaginationMeta` — pagination info
|
|
293
|
+
|
|
294
|
+
#### `PaginationMeta`
|
|
295
|
+
|
|
296
|
+
- `current_page: int`
|
|
297
|
+
- `page_size: int`
|
|
298
|
+
- `total_count: int`
|
|
299
|
+
- `total_pages: int`
|
|
300
|
+
|
|
243
301
|
## Error Handling
|
|
244
302
|
|
|
245
303
|
The SDK provides specific exception types for different error conditions:
|
|
@@ -273,10 +331,9 @@ except Channel3ConnectionError:
|
|
|
273
331
|
|
|
274
332
|
## Requirements
|
|
275
333
|
|
|
276
|
-
- Python 3.
|
|
334
|
+
- Python 3.9+
|
|
277
335
|
- requests
|
|
278
|
-
-
|
|
279
|
-
- pydantic
|
|
336
|
+
- httpx
|
|
280
337
|
|
|
281
338
|
## License
|
|
282
339
|
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
channel3_sdk/__init__.py,sha256=mYmvZ2ahuAxzy_1gtroB8qpK_u_tuKoDCm5C_LHRwRg,1696
|
|
2
|
+
channel3_sdk/_gen/.gitignore,sha256=SwZvl9qyKaHN9YjwaQrBsmpAclN11usf9Gohz1SFVg8,195
|
|
3
|
+
channel3_sdk/_gen/README.md,sha256=d6VMPYuhTiK-WEKNRd-zbIG_uzYOVWkVvPBgDEPVwnc,4997
|
|
4
|
+
channel3_sdk/_gen/fast_api_client/__init__.py,sha256=qUheje2C4lZ8b26EUHXHRJ3dWuzKiExv_JVOdVCFAek,150
|
|
5
|
+
channel3_sdk/_gen/fast_api_client/api/__init__.py,sha256=zTSiG_ujSjAqWPyc435YXaX9XTlpMjiJWBbV-f-YtdA,45
|
|
6
|
+
channel3_sdk/_gen/fast_api_client/api/channel3_api/__init__.py,sha256=5vd9uJWAjRqa9xzxzYkLD1yoZ12Ld_bAaNB5WX4fbE8,56
|
|
7
|
+
channel3_sdk/_gen/fast_api_client/api/channel3_api/get_brand_detail_v0_brands_brand_id_get.py,sha256=yNOOiKimIDQONHCH3i5KBnYa1LvEjD6THXjCyLgE-tU,4611
|
|
8
|
+
channel3_sdk/_gen/fast_api_client/api/channel3_api/get_brands_v0_brands_get.py,sha256=KfCOw1595dAcV1IT9Vuddz1EKiaHOb2BBrVcmNsczL0,6075
|
|
9
|
+
channel3_sdk/_gen/fast_api_client/api/channel3_api/get_product_detail_v0_products_product_id_get.py,sha256=8d3Z4CXdph42GcYSjqaVFqz54Ct2D8tqwZ8PXn66Xyo,4778
|
|
10
|
+
channel3_sdk/_gen/fast_api_client/api/channel3_api/search_v0_search_post.py,sha256=TV2_222dJtv8nmVXxGGznB-maWlHZB96nxJAhxQz6T0,4944
|
|
11
|
+
channel3_sdk/_gen/fast_api_client/api/default/__init__.py,sha256=5vd9uJWAjRqa9xzxzYkLD1yoZ12Ld_bAaNB5WX4fbE8,56
|
|
12
|
+
channel3_sdk/_gen/fast_api_client/api/default/root_get.py,sha256=83wq3kzLX9On8L2L8wldOgIf90e5fUsTT6dbC2bvfYM,2063
|
|
13
|
+
channel3_sdk/_gen/fast_api_client/client.py,sha256=o_mdLqyBCQstu5tS1WZFwqIEbGwkvWQ7eQjuCJw_5VY,12419
|
|
14
|
+
channel3_sdk/_gen/fast_api_client/errors.py,sha256=gO8GBmKqmSNgAg-E5oT-oOyxztvp7V_6XG7OUTT15q0,546
|
|
15
|
+
channel3_sdk/_gen/fast_api_client/models/__init__.py,sha256=Yc0J6woL8dLhHW0VZbZuSV17-9DHR-qpk63sC6SiNVc,1059
|
|
16
|
+
channel3_sdk/_gen/fast_api_client/models/availability_status.py,sha256=yC7hCgFwU_CcIfnS2UggdFdNWsoq0lvrdrR5n43tIto,361
|
|
17
|
+
channel3_sdk/_gen/fast_api_client/models/brand.py,sha256=hEObzXznweXyzLjiSQl0pUBYquCrn09XKcFSKtjoQfk,2986
|
|
18
|
+
channel3_sdk/_gen/fast_api_client/models/error_response.py,sha256=hGdOt8lakOZFh9YlOE53zEq9Ektv6cOQTIbqtRLg4TQ,1467
|
|
19
|
+
channel3_sdk/_gen/fast_api_client/models/paginated_response_brand.py,sha256=TPd0tEzvE7TxE7DhpSsh5p4FpP1muHSYQezwZ9Yxcas,2330
|
|
20
|
+
channel3_sdk/_gen/fast_api_client/models/pagination_meta.py,sha256=iF8W1dOyuDb4Y5Wa5HviYfXjPJkayK5R68JgNA7rwY4,2185
|
|
21
|
+
channel3_sdk/_gen/fast_api_client/models/price.py,sha256=aol4R82ffjKvsrzch-P1iw5HwT0FcCqUmGvjb65lPmM,2617
|
|
22
|
+
channel3_sdk/_gen/fast_api_client/models/product.py,sha256=XkKaBA89YOaMh9XSTEdBkvO8miQVED8nNquAO75bw1s,4485
|
|
23
|
+
channel3_sdk/_gen/fast_api_client/models/product_detail.py,sha256=PybK6gS_yxmjIax7ryH6pha69T-iCNR8IjtWHn8cFVU,9850
|
|
24
|
+
channel3_sdk/_gen/fast_api_client/models/product_detail_gender_type_0.py,sha256=iz4Yx9AiuvITYK5r1C_8hUY09GyVtJ7Saru7FdeDGLQ,191
|
|
25
|
+
channel3_sdk/_gen/fast_api_client/models/search_config.py,sha256=nVjpdhESU7IJiCW4HCdq1hUGDVtrhXhFJqrjDgGHzlc,2031
|
|
26
|
+
channel3_sdk/_gen/fast_api_client/models/search_filter_price.py,sha256=GFaLgoXXRkLpX39b3w0JpZRek026DQEp-UfRMaXmMXs,2864
|
|
27
|
+
channel3_sdk/_gen/fast_api_client/models/search_filters.py,sha256=KjioDMmVINN2vR1iCEj7GH9ME6BfmI17a1jgiMyd8xU,6657
|
|
28
|
+
channel3_sdk/_gen/fast_api_client/models/search_filters_gender_type_0.py,sha256=52XYojpfDdj_LV_9gQbsGWP_aANJ1-KiZOogxn4noms,191
|
|
29
|
+
channel3_sdk/_gen/fast_api_client/models/search_request.py,sha256=oqQcXcH1Psp-Qwx8_MFhyPIB60gBMo-IpPnBp24DUmg,6156
|
|
30
|
+
channel3_sdk/_gen/fast_api_client/models/variant.py,sha256=G3T1E5sBZmJb2hYeb9V3ACaUqVBhqX9gRvI_ooHFgVI,1820
|
|
31
|
+
channel3_sdk/_gen/fast_api_client/py.typed,sha256=8ZJUsxZiuOy1oJeVhsTWQhTG_6pTVHVXk5hJL79ebTk,25
|
|
32
|
+
channel3_sdk/_gen/fast_api_client/types.py,sha256=AX4orxQZQJat3vZrgjJ-TYb2sNBL8kNo9yqYDT-n8y8,1391
|
|
33
|
+
channel3_sdk/_gen/pyproject.toml,sha256=m8NKk1ztXdKounkQTmYgzcML-jmumnMdLLielJAam0k,544
|
|
34
|
+
channel3_sdk/client.py,sha256=5yJJiucJiTl-BV_zKaGch57OQSpIEJjWD5TPHaaapl4,13658
|
|
35
|
+
channel3_sdk/exceptions.py,sha256=5HJgrhir4-_b4XKyWAB9qp-CjVZeigXSkyM9fbcB1IA,1044
|
|
36
|
+
channel3_sdk-1.0.0.dist-info/METADATA,sha256=WGfNoiIoxP86MfoglDbOJofwBlLkzhcidBj91Bg1vL8,9028
|
|
37
|
+
channel3_sdk-1.0.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
38
|
+
channel3_sdk-1.0.0.dist-info/RECORD,,
|
channel3_sdk/models.py
DELETED
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
"""Pydantic models for the Channel3 API."""
|
|
2
|
-
|
|
3
|
-
from enum import Enum
|
|
4
|
-
from typing import List, Optional, Literal
|
|
5
|
-
from pydantic import BaseModel, Field
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class AvailabilityStatus(str, Enum):
|
|
9
|
-
"""Availability status of a product."""
|
|
10
|
-
|
|
11
|
-
IN_STOCK = "InStock"
|
|
12
|
-
OUT_OF_STOCK = "OutOfStock"
|
|
13
|
-
PRE_ORDER = "PreOrder"
|
|
14
|
-
LIMITED_AVAILABILITY = "LimitedAvailability"
|
|
15
|
-
BACK_ORDER = "BackOrder"
|
|
16
|
-
DISCONTINUED = "Discontinued"
|
|
17
|
-
SOLD_OUT = "SoldOut"
|
|
18
|
-
UNKNOWN = "Unknown"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
class Price(BaseModel):
|
|
22
|
-
"""Price information for a product."""
|
|
23
|
-
|
|
24
|
-
price: float = Field(
|
|
25
|
-
..., description="The current price of the product, including any discounts."
|
|
26
|
-
)
|
|
27
|
-
compare_at_price: Optional[float] = Field(
|
|
28
|
-
None, description="The original price of the product before any discounts."
|
|
29
|
-
)
|
|
30
|
-
currency: str = Field(..., description="The currency code of the product.")
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
class Brand(BaseModel):
|
|
34
|
-
"""A brand."""
|
|
35
|
-
|
|
36
|
-
id: str = Field(..., description="Unique identifier for the brand")
|
|
37
|
-
name: str = Field(..., description="Name of the brand")
|
|
38
|
-
logo_url: Optional[str] = Field(None, description="Logo URL for the brand")
|
|
39
|
-
description: Optional[str] = Field(None, description="Description of the brand")
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
class Variant(BaseModel):
|
|
43
|
-
"""A product variant."""
|
|
44
|
-
|
|
45
|
-
product_id: str = Field(..., description="Unique identifier for the product")
|
|
46
|
-
title: str = Field(..., description="Title of the variant")
|
|
47
|
-
image_url: str = Field(..., description="Image URL for the variant")
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
class Product(BaseModel):
|
|
51
|
-
"""A product returned from search."""
|
|
52
|
-
|
|
53
|
-
id: str = Field(..., description="Unique identifier for the product")
|
|
54
|
-
url: str = Field(..., description="URL for the product")
|
|
55
|
-
score: float = Field(..., description="Relevance score for the search query")
|
|
56
|
-
title: str = Field(..., description="Product title")
|
|
57
|
-
description: Optional[str] = Field(None, description="Product description")
|
|
58
|
-
brand: Brand = Field(..., description="Brand of the product")
|
|
59
|
-
image_url: str = Field(..., description="Main product image URL")
|
|
60
|
-
price: Price = Field(..., description="Price information")
|
|
61
|
-
availability: AvailabilityStatus = Field(
|
|
62
|
-
..., description="Product availability status"
|
|
63
|
-
)
|
|
64
|
-
variants: List[Variant] = Field(
|
|
65
|
-
default_factory=list, description="Product variants"
|
|
66
|
-
)
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
class ProductDetail(BaseModel):
|
|
70
|
-
"""Detailed information about a product."""
|
|
71
|
-
|
|
72
|
-
id: str = Field(..., description="Unique identifier for the product")
|
|
73
|
-
url: str = Field(..., description="URL for the product")
|
|
74
|
-
score: float = Field(..., description="Relevance score for the search query")
|
|
75
|
-
title: str = Field(..., description="Product title")
|
|
76
|
-
description: Optional[str] = Field(None, description="Product description")
|
|
77
|
-
brand_id: Optional[str] = Field(None, description="Unique identifier for the brand")
|
|
78
|
-
brand_name: Optional[str] = Field(None, description="Brand name of the product")
|
|
79
|
-
image_urls: Optional[List[str]] = Field(
|
|
80
|
-
None, description="List of product image URLs"
|
|
81
|
-
)
|
|
82
|
-
price: Price = Field(..., description="Price information")
|
|
83
|
-
availability: AvailabilityStatus = Field(
|
|
84
|
-
..., description="Product availability status"
|
|
85
|
-
)
|
|
86
|
-
gender: Optional[Literal["unisex", "men", "women"]] = Field(
|
|
87
|
-
None, description="Gender of the product, if applicable"
|
|
88
|
-
)
|
|
89
|
-
materials: Optional[List[str]] = Field(
|
|
90
|
-
None, description="List of materials, if applicable"
|
|
91
|
-
)
|
|
92
|
-
key_features: Optional[List[str]] = Field(
|
|
93
|
-
None, description="List of key product features"
|
|
94
|
-
)
|
|
95
|
-
variants: List[Variant] = Field(
|
|
96
|
-
default_factory=list, description="Product variants"
|
|
97
|
-
)
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
class SearchFilterPrice(BaseModel):
|
|
101
|
-
"""Price filter for product search."""
|
|
102
|
-
|
|
103
|
-
min_price: Optional[float] = Field(None, description="Minimum price filter")
|
|
104
|
-
max_price: Optional[float] = Field(None, description="Maximum price filter")
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
class SearchFilters(BaseModel):
|
|
108
|
-
"""Search filters for product search."""
|
|
109
|
-
|
|
110
|
-
brand_ids: Optional[List[str]] = Field(
|
|
111
|
-
None, description="List of brand IDs to filter by"
|
|
112
|
-
)
|
|
113
|
-
gender: Optional[Literal["male", "female", "unisex"]] = Field(
|
|
114
|
-
None, description="Gender to filter by"
|
|
115
|
-
)
|
|
116
|
-
price: Optional[SearchFilterPrice] = Field(
|
|
117
|
-
None, description="Price range to filter by"
|
|
118
|
-
)
|
|
119
|
-
availability: Optional[List[AvailabilityStatus]] = Field(
|
|
120
|
-
None, description="Availability statuses to filter by"
|
|
121
|
-
)
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
class SearchRequest(BaseModel):
|
|
125
|
-
"""Request model for product search."""
|
|
126
|
-
|
|
127
|
-
query: Optional[str] = Field(None, description="Text search query")
|
|
128
|
-
image_url: Optional[str] = Field(None, description="URL of image for visual search")
|
|
129
|
-
base64_image: Optional[str] = Field(
|
|
130
|
-
None, description="Base64-encoded image for visual search"
|
|
131
|
-
)
|
|
132
|
-
limit: Optional[int] = Field(
|
|
133
|
-
default=20, description="Maximum number of results to return"
|
|
134
|
-
)
|
|
135
|
-
filters: Optional[SearchFilters] = Field(default=None, description="Search filters")
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
channel3_sdk/__init__.py,sha256=vMrsZwY59OoYmoPwEnZ0kuAuWFkOIERUaoy0lWpGIlc,976
|
|
2
|
-
channel3_sdk/client.py,sha256=wNqM9d7M2eiWOZ0Xp9rJGjINUrsaHYXiBJktBfPD-18,20776
|
|
3
|
-
channel3_sdk/exceptions.py,sha256=5HJgrhir4-_b4XKyWAB9qp-CjVZeigXSkyM9fbcB1IA,1044
|
|
4
|
-
channel3_sdk/models.py,sha256=K9D2scDVQzrC1s74xJ9Orj6yFCGfqqKZ4AvDBSWWpi0,5030
|
|
5
|
-
channel3_sdk-0.2.1.dist-info/METADATA,sha256=RWOkOFH9jZlGFdTS1PgvfRiovqbfjBAOEne3xsJR-Mo,7799
|
|
6
|
-
channel3_sdk-0.2.1.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
7
|
-
channel3_sdk-0.2.1.dist-info/RECORD,,
|