File packages/amazon_data_upload.py changed (mode: 100644) (index 3e4bd0d..0e82e4b) |
... |
... |
def amazonSkuUpload(flatfile, export): |
20 |
20 |
item_number = 1 |
item_number = 1 |
21 |
21 |
for row in reader: |
for row in reader: |
22 |
22 |
if(row['VariationID']): |
if(row['VariationID']): |
23 |
|
values = [row['VariationID'], '4', '0', '', ''] |
|
|
23 |
|
values = [row['VariationID'], '104', '0', '', ''] |
24 |
24 |
Data[row['VariationNumber']] = SortedDict( |
Data[row['VariationNumber']] = SortedDict( |
25 |
25 |
zip(column_names, values)) |
zip(column_names, values)) |
26 |
26 |
|
|
|
... |
... |
def amazonSkuUpload(flatfile, export): |
36 |
36 |
|
|
37 |
37 |
def amazonDataUpload(flatfile, export): |
def amazonDataUpload(flatfile, export): |
38 |
38 |
|
|
39 |
|
column_names = ['ItemAmazonProductType', 'ItemAmazonFBA', 'bullet_point1', |
|
40 |
|
'bullet_point2', 'bullet_point3', 'bullet_point4', |
|
41 |
|
'bullet_point5', 'fit_type', |
|
42 |
|
'lifestyle', 'batteries_required', |
|
43 |
|
'supplier_declared_dg_hz_regulation1', |
|
44 |
|
'supplier_declared_dg_hz_regulation2', |
|
45 |
|
'supplier_declared_dg_hz_regulation3', |
|
46 |
|
'supplier_declared_dg_hz_regulation4', |
|
47 |
|
'supplier_declared_dg_hz_regulation5', 'ItemID', |
|
48 |
|
'ItemShippingWithAmazonFBA'] |
|
|
39 |
|
column_names = [ |
|
40 |
|
'ItemAmazonProductType', 'ItemAmazonFBA', |
|
41 |
|
'bullet_point1','bullet_point2', 'bullet_point3', |
|
42 |
|
'bullet_point4', 'bullet_point5', |
|
43 |
|
'fit_type', 'lifestyle', 'batteries_required', |
|
44 |
|
'supplier_declared_dg_hz_regulation1', |
|
45 |
|
'department_name', 'variation_theme', 'collection_name', |
|
46 |
|
'material_composition', 'size_map', 'size_name', |
|
47 |
|
'color_map', 'ItemID','ItemShippingWithAmazonFBA' |
|
48 |
|
] |
49 |
49 |
|
|
50 |
50 |
Data = SortedDict() |
Data = SortedDict() |
51 |
51 |
|
|
|
... |
... |
def amazonDataUpload(flatfile, export): |
77 |
77 |
row['bullet_point5'], row['fit_type'], |
row['bullet_point5'], row['fit_type'], |
78 |
78 |
row['lifestyle'], row['batteries_required'], |
row['lifestyle'], row['batteries_required'], |
79 |
79 |
row['supplier_declared_dg_hz_regulation1'], |
row['supplier_declared_dg_hz_regulation1'], |
80 |
|
row['supplier_declared_dg_hz_regulation2'], |
|
81 |
|
row['supplier_declared_dg_hz_regulation3'], |
|
82 |
|
row['supplier_declared_dg_hz_regulation4'], |
|
83 |
|
row['supplier_declared_dg_hz_regulation5'], |
|
84 |
|
'','1'] |
|
|
80 |
|
row['department_name'], |
|
81 |
|
row['variation_theme'], |
|
82 |
|
row['collection_name'], |
|
83 |
|
row['material_composition'], |
|
84 |
|
row['size_map'], |
|
85 |
|
row['size_name'], |
|
86 |
|
row['color_map'], |
|
87 |
|
'0','1'] |
|
88 |
|
|
85 |
89 |
Data[row['item_sku']] = SortedDict(zip(column_names, values)) |
Data[row['item_sku']] = SortedDict(zip(column_names, values)) |
86 |
90 |
|
|
|
91 |
|
if(row['parent_child'] == 'child' and row['parent_sku'] in [*Data]): |
|
92 |
|
for key in column_names: |
|
93 |
|
if(not(Data[ row[ 'parent_sku' ] ][ key ])): |
|
94 |
|
try: |
|
95 |
|
Data[ row[ 'parent_sku' ] ][ key ] = row[ key ] |
|
96 |
|
except Exception as err: |
|
97 |
|
print(err) |
|
98 |
|
|
|
99 |
|
|
87 |
100 |
with open(export, mode='r') as item: |
with open(export, mode='r') as item: |
88 |
101 |
reader = csv.DictReader(item, delimiter=";") |
reader = csv.DictReader(item, delimiter=";") |
89 |
102 |
|
|
File packages/item_upload.py changed (mode: 100644) (index 7130bff..09aff3f) |
... |
... |
def itemPropertyUpload(flatfile, export): |
131 |
131 |
if(re.search(r'(cotton|baumwolle)', |
if(re.search(r'(cotton|baumwolle)', |
132 |
132 |
row['outer_material_type'].lower())): |
row['outer_material_type'].lower())): |
133 |
133 |
|
|
134 |
|
material[row['item_sku']] = 4 |
|
|
134 |
|
material[row['item_sku']] = 7 |
135 |
135 |
value[row['item_sku']] = "Baumwolle" |
value[row['item_sku']] = "Baumwolle" |
136 |
136 |
if(re.search(r'(hemp|hanf)', |
if(re.search(r'(hemp|hanf)', |
137 |
137 |
row['outer_material_type'].lower())): |
row['outer_material_type'].lower())): |
138 |
138 |
|
|
139 |
|
material[row['item_sku']] = 5 |
|
|
139 |
|
material[row['item_sku']] = 7 |
140 |
140 |
value[row['item_sku']] = "Hanf" |
value[row['item_sku']] = "Hanf" |
141 |
141 |
if(re.search(r'(viskose|viscose)', |
if(re.search(r'(viskose|viscose)', |
142 |
142 |
row['outer_material_type'].lower())): |
row['outer_material_type'].lower())): |
143 |
143 |
|
|
144 |
|
material[row['item_sku']] = 6 |
|
145 |
|
value[row['item_sku']] = "Viskose" |
|
|
144 |
|
material[row['item_sku']] = 7 |
|
145 |
|
value[row['item_sku']] = "Viskose" |
146 |
146 |
|
|
147 |
147 |
with open(export, mode='r') as item: |
with open(export, mode='r') as item: |
148 |
148 |
reader = csv.DictReader(item, delimiter=';', lineterminator='\n') |
reader = csv.DictReader(item, delimiter=';', lineterminator='\n') |
|
... |
... |
def itemPropertyUpload(flatfile, export): |
153 |
153 |
Data = {} |
Data = {} |
154 |
154 |
for row in reader: |
for row in reader: |
155 |
155 |
if(row['AttributeValueSetID'] == ''): |
if(row['AttributeValueSetID'] == ''): |
156 |
|
values = ['3', |
|
157 |
|
row['ItemID'], |
|
158 |
|
row['VariationName'], |
|
159 |
|
'de', |
|
160 |
|
'PANASIAM'] |
|
161 |
|
|
|
162 |
|
Data[row['VariationNumber'] + '1'] = dict(zip(column_names, |
|
163 |
|
values)) |
|
164 |
156 |
if(row['VariationNumber'] in [*material]): |
if(row['VariationNumber'] in [*material]): |
165 |
157 |
values = [material[row['VariationNumber']], |
values = [material[row['VariationNumber']], |
166 |
158 |
row['ItemID'], |
row['ItemID'], |
|
... |
... |
def itemPropertyUpload(flatfile, export): |
168 |
160 |
'de', |
'de', |
169 |
161 |
value[row['VariationNumber']]] |
value[row['VariationNumber']]] |
170 |
162 |
|
|
171 |
|
Data[row['VariationNumber'] + '2'] = dict(zip(column_names, |
|
|
163 |
|
Data[row['VariationNumber'] + '1'] = dict(zip(column_names, |
172 |
164 |
values)) |
values)) |
173 |
165 |
variation_upload.writeCSV(Data, "property", column_names) |
variation_upload.writeCSV(Data, "property", column_names) |