-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjson_serialize.py
More file actions
executable file
·330 lines (321 loc) · 10.8 KB
/
json_serialize.py
File metadata and controls
executable file
·330 lines (321 loc) · 10.8 KB
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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
#!/usr/bin/python3
"""Serialise outfit items data to json files"""
import json
# Dictionary of clothing items of the top category
outfit_tops_dict = {
'casual': {
'male': ['t-shirt',
['round-necked sweater', 'collared shirt'],
'plain top',
'polo shirt',
'casual button-down shirt',
'flannel shirt',
'oxford shirt',
'rugby shirt',
'baseball shirt',
['t-shirt', 'hoodie'],
'crewneck sweater',
['V-neck sweater', 'button-down shirt'],
['button-down shirt', 'cardigan'],
'tank top',
'rugby shirt',
'turtle-neck sweater',
'raglan-sleeved baseball shirt',
'camp shirt',
'denim shirt',
'linen shirt',
['fleece jacket', 't-shirt']
],
'female': ['plain blouse',
['sleeveless top', 'shawl'],
'turtle-necked top',
'camisole',
'crop top',
'button-down shirt',
'tunic',
'off-the-shoulder top',
'cold shoulder top',
'halter top',
'wrap top',
'kimono top',
['camisole', 'cardigan'],
['v-neck sweater', 'turtle-neck top'],
['v-neck sweater', 'round-neck blouse'],
'denim shirt',
'flannel shirt',
['flannel shirt', 'camisole'],
'ruffled blouse',
'bell-sleeve blouse',
'peplum top',
'one-shoulder top',
'polo shirt',
'crochet top',
'satin top',
'linen top',
]
},
'dinner': {
'male': ['silk button-down shirt',
'plaid T-shirt',
'dress shirt, tie',
'henley shirt',
'oxford shirt',
'flannel shirt',
['v-neck sweater', 'button-down shirt'],
['blazer', 'dress shirt'],
['sport coat', 'button-down shirt'],
['waist coat and tie', 'long-sleeved shirt'],
'turtle-neck sweater',
'mock neck sweater',
'silk polo shirt',
'patterned shirt',
'dinner suit',
'cashmere sweater'
],
'female': ['flowered blouse',
'dressy blouse',
'top with flared sleeves',
['silk camisole', 'blazer'],
['satin camisole', 'jacket'],
'off-the-shoulder top',
'wrap top',
'peplum top',
'lace top',
'sequin top',
'ruffled blouse',
'halter top',
'one-shoulder top',
'draped top',
'bell-sleeve blouse',
'embroidered top',
'crochet top',
'turtle-neck top',
'v-neck top',
'button-down shirt',
'wool cardigan',
'cape top',
'boat-neck top'
]
},
'exercise': {
'male': ['sweatshirt',
'sleeveless top'
'tank top',
'long-sleeve performance shirt'
'hoodie',
'sweatshirt',
'muscle tank',
'polo shirt',
'baseball shirt',
'running singlet',
'cycling jersey',
'compression tank top',
'running hoodie',
'yoga top',
'track jacket',
'sleeveless hoodie',
'mesh shirt'
],
'female': ['sleeveless breathable top',
'light long-sleeved cotton blouse',
'sports bra',
'cycling jersey',
'sleeveless top',
'tank top',
'compression tank top',
'running hoodie',
'yoga top',
'track jacket',
'sleeveless hoodie',
'mesh shirt'
]
}
}
# Dictionary of clothing items of the bottom category
outfit_bottoms_dict = {
'casual': {
'male': ['jean trousers',
'cargo pants',
'khaki shorts',
'chinos',
'track pants',
'denim shorts',
'cargo shorts',
'joggers',
'linen pants',
'dress pants',
'jorts',
'wool trousers',
'harem pants',
'yoga pants',
'cycling shorts',
'leather pants'
],
'female': ['flared skirt',
'straight skirt',
'leggings',
'boyfriend jeans',
'bootcut jeans',
'flared jeans',
'leggings',
'chinos',
'cargo pants',
'khakis',
'sweatpants',
'shorts',
'midi skirt',
'pencil skirt',
'maxi skirt',
'pleated skirt',
'palazzo pants',
'jeggings',
'bike shorts',
'leather pants',
'linen trousers',
'denim skirt',
'wrap skirt'
]
},
'dinner': {
'male': ['pants trousers',
'silk trousers',
'suit trousers',
'corduroy pants',
'tweed trousers',
'linen pants',
'denim jeans',
'pleated pants',
'leather pants',
'flannel-lined pants',
'satin pants'
],
'female': ['skirt',
'flared skirt',
'dress pants',
'palazzo pants',
'maxi skirt',
'midi skirt',
'pencil skirt',
'high-waisted skirt',
'sequin pants',
'velvet skirt',
'velvet pants',
'lace skirt',
'high-waisted wide-leg pants',
'tuxedo pants',
'crochet skirt'
]
},
'exercise': {
'male': ['3/4 shorts',
'athletic shorts',
'athletic leggings',
'track pants',
'joggers',
'training shorts',
'cycling shorts',
'sweatpants',
'yoga pants',
'basketball pants',
'hiking pants',
'running tights',
'spandex shorts',
'thermal leggings'
],
'female': ['biker shorts',
'leggings',
'yoga pants',
'running shorts',
'athletic shorts',
'capri leggings',
'cycling shorts',
'joggers',
'track pants',
'training shorts',
'skorts',
'high-waisted leggings',
'dance shorts',
'running tights',
'spandex shorts'
]
}
}
# Dictionary if formal clothing items
formal_outfits_dict = {
'female': [
[['suit skirt'],['suit']],
[['tights'], ['evening gown']],
[['tights'], ['cocktail dress']],
[['tights'], ['ball gown']],
[['tights'], ['sheath dress']],
[['tights'], ['A-line dress']],
[['tights'], ['empire waist dress']],
[['tights'], ['wrap dress']],
[['tights'], ['peplum dress']],
[['tights'], ['halter dress']],
[['tights'], ['lace gown']],
[['tailored trousers'], ['blazer']],
[['tailored skirt'], ['blazer']],
[['plaid skirt'], ['jacket', 'camisole']]
],
'male': [
[['trousers'], ['tuxedo']],
[['trousers'], ['suit', 'shirt']],
[['trousers'], ['three-piece suit']],
[['black trousers'], ['dinner jacket']],
[['formal trousers'], ['tailcoat']],
[['trousers'], ['double-breasted suit']],
[['trousers'], ['velvet dinner jacket']]
]
}
# Hold status of user- if the app is being used for the first time
# to enable user registration page
status_dict = {'new': 'yes'}
# Serialize all dictionaries into their respective json files"
#with open ("json_files/colours.json", "w") as json_colour:
# json.dump(colours_dict, json_colour, indent = 3)
with open ("json_files/tops.json", "w") as json_top:
json.dump(outfit_tops_dict, json_top, indent = 3)
with open ("json_files/bottoms.json", "w") as json_bottom:
json.dump(outfit_bottoms_dict, json_bottom, indent = 3)
with open ("json_files/formal_outfits.json", "w") as json_formal:
json.dump(formal_outfits_dict, json_formal, indent = 3)
with open ("json_files/status.json", "w") as json_status:
json.dump(status_dict, json_status, indent = 3)
"""
colours_dict = dict({
"red" : "255,0,0" , # RGB Hex Code for Red
"green": "0,128,0", # RGB Hex Code for Green
"blue": "0,0,255", # RGB HEX Code for Blue
"white": "255,255,255", # RGB Hex Code for White
"black": "0,0,0", # RGB Hex Code for Black
"yellow": "255,255,0", # Yellow Color in RGB
"navl blue": "0,68,174", # Navy Blue color in RGB
"gold": "255,193,0",
"pink": "255,192,203",
"orange": "255,165,0",
"cyan": "0,255,255",
"magenta": "255,0,255",
"brown": "165,42,42",
"lime": "0,255,0",
"purple": "128,0,128",
"tan": "210,180,140",
"teal": "0,128,128",
"olive": "128,128,0",
"light brown": "181,101,29",
"bronze": "205,127,50",
"ochre": "204,119,34",
"black bean": "61,12,2",
"dark salmon": "233,150,122",
"chocolate": "210,105,30",
"sky blue": "135,206,235",
"royal blue": "65,105,225",
"dark blue": "0,0,139",
"cobalt": "0,71,171",
"imperial blue": "0,35,149",
"grey": "128,128,128",
"light grey": "211,211,211",
"violet": "143,0,255",
"indigo": "75,0,130",
})
"""