Created
October 25, 2016 16:59
-
-
Save tmkasun/34b16437e2a99ccb6653ad581bdf90a9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(" ", "_") | |
else: | |
break | |
create_asset(json_data, asset_name) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment