forked from jhnwr/terrex-scraper
-
Notifications
You must be signed in to change notification settings - Fork 1
/
models.py
183 lines (142 loc) · 3.76 KB
/
models.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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
62
63
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
from __future__ import annotations
from typing import Any, Dict, List, Optional
from pydantic import BaseModel
# had issues with missing data over several models so have commented some out below
class MetaData(BaseModel):
canonical: str
description: str
keywords: str
page_title: str
site_name: str
class Metadata(BaseModel):
asset_usage: List[str]
asset_category: str
imageStyle: str
view: str
usageTerms: str
sortOrder: str
subjects: List
class ViewListItem(BaseModel):
type: str
source: str
image_url: str
metadata: Optional[Metadata]
class SizeFitBar(BaseModel):
value: str
markerCount: int
selectedMarkerIndex: int
class AttributeList(BaseModel):
sale: bool
brand: str
color: str
gender: str
outlet: bool
sport: List[str]
closure: List[str]
surface: List[str]
category: str
sportSub: List[str]
size_fit_bar: SizeFitBar
collection: List[str]
search_color: str
base_material: List[str]
productType: List[str]
personalizable: bool
isCnCRestricted: bool
key_category_code: str
productLineStyle: Optional[List[str]]
mandatory_personalization: bool
sustainability_ethics_compliance_ids: List[str]
customizable: bool
search_color_raw: str
is_orderable: bool
isWaitingRoomProduct: bool
isInPreview: bool
specialLaunch: bool
special_launch_type: str
sizeTypes: Dict[str, Any]
is_flash: bool
size_chart_link: str
class BreadcrumbListItem(BaseModel):
text: str
link: str
class PricingInformation(BaseModel):
currentPrice: int
standard_price: int
standard_price_no_vat: int
class WashCareInstructions(BaseModel):
care_instructions: List
class ProductHighlight(BaseModel):
hcopy: str
headline: str
image_reference: Any
class DescriptionAssets(BaseModel):
image_url: str
video_url: Any
poster_url: Any
class ProductDescription(BaseModel):
title: str
text: str
subtitle: str
usps: Optional[List[str]]
wash_care_instructions: WashCareInstructions
# product_highlights: Optional[List[ProductHighlight]]
description_assets: DescriptionAssets
class PricingInformation1(BaseModel):
standard_price: int
sale_price: Optional[int] = None
class ProductLinkListItem(BaseModel):
type: str
productId: str
name: str
url: str
image: str
altImage: str
pricing_information: PricingInformation1
search_color: str
default_color: str
source: str
available_skus: int
badge_style: Optional[str] = None
badge_text: Optional[str] = None
class Field(BaseModel):
type: str
key: str
maxLength: int
minLength: int
validation: str
textColor: str
usesStock: bool
stockCollection: Any
class EmbellishmentOption(BaseModel):
position: str
positionPrice: int
allowChooseOwnText: bool
fields: List[Field]
class Embellishment(BaseModel):
embellishmentOptions: Optional[List[EmbellishmentOption]]
articleType: str
class Model(BaseModel):
id: str
product_type: str
model_number: str
name: str
# meta_data: MetaData
# view_list: List[ViewListItem]
# attribute_list: AttributeList
# breadcrumb_list: List[BreadcrumbListItem]
pricing_information: PricingInformation
product_description: Optional[ProductDescription]
# recommendationsEnabled: bool
# product_link_list: List[ProductLinkListItem]
# embellishment: Optional[Embellishment]
class VariationListItem(BaseModel):
sku: str
size: str
availability: int
availability_status: str
instock_date: Optional[str] = None
class Availability(BaseModel):
id: str
availability_status: str
variation_list: Optional[List[VariationListItem]]