spreadsheet.py: lowercase all text for NuOrder

This commit is contained in:
2019-10-28 21:50:56 -07:00
parent 5c3ad32cb5
commit ec428c1881

View File

@ -35,7 +35,7 @@ def write_spreadsheet(matches, workdir, file_base):
ws = wb.active
# header row
ws.append(['Style Number', 'Product Name', 'Season', 'Color', 'Category', 'Size Range'])
ws.append(['style number', 'product name', 'season', 'color', 'category', 'size range'])
# style the header row
ws.column_dimensions['A'].width = 15
@ -57,13 +57,13 @@ def write_spreadsheet(matches, workdir, file_base):
for m in matches:
# in the case of kids,
# we might have multiple products in a match
seasons = m['season'].split('\n')
genders = m['gender'].split('\n')
names = m['name'].split('\n')
materials = m['material'].split('\n')
colors = m['color'].split('\n')
sizes = m['size'].split('\n')
categories = m['category'].split('\n')
seasons = m['season'].lower().split('\n')
genders = m['gender'].lower().split('\n')
names = m['name'].lower().split('\n')
materials = m['material'].lower().split('\n')
colors = m['color'].lower().split('\n')
sizes = m['size'].lower().split('\n')
categories = m['category'].lower().split('\n')
for s, g, n, m, c, sz, ct in zip_longest(seasons, genders, names, materials, colors, sizes, categories, fillvalue=''):
if not m in seen: