Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
def main():
wb = openpyxl.load_workbook(conf['excel_file'])
name = wb.get_sheet_names()[0]
sheet = wb.get_sheet_by_name(name)
for row in range(2, sheet.max_row): # from 2 (assuming first row contains headers) to end of the rows
condition = sheet.cell(row=row, column=1).value
color = sheet.cell(row=row, column=2).value
year = sheet.cell(row=row, column=3).value
name = sheet.cell(row=row, column=4).value
description = sheet.cell(row=row, column=5).value
body = sheet.cell(row=row, column=6).value
notes = sheet.cell(row=row, column=7).value
json_data = get_json(condition, color, year, name, description, body, notes)
if name:
asset_name = name.replace(" ", "_")
create_asset(json_data, asset_name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment