MCPcopy
hub / github.com/omkarcloud/botasaurus / write_excel

Function write_excel

botasaurus/output.py:371–385  ·  view source on GitHub ↗
(data, filename, log=True, convert_strings_to_urls=True)

Source from the content-addressed store, hash-verified

369 filename = filename + ".xlsx"
370 return filename
371def write_excel(data, filename, log=True, convert_strings_to_urls=True):
372
373 data = clean_data(data)
374 data = convert_nested_to_json_for_excel(data)
375
376 try:
377 filename = fix_excel_filename(filename)
378 write_workbook(data, filename, convert_strings_to_urls)
379
380 if log:
381 print(f"View written Excel file at {filename}")
382 except PermissionError:
383 prompt(f"{filename} is currently open in another application (e.g., Excel). Please close the the Application and press 'Enter' to save.")
384 return write_excel(data, filename, log, convert_strings_to_urls)
385 return filename
386MAX_EXCEL_LINKS = 65528
387def write_workbook(data, filename, strings_to_urls = True):
388 import xlsxwriter

Callers 2

write_temp_excelFunction · 0.85
write_outputFunction · 0.85

Calls 5

fix_excel_filenameFunction · 0.85
write_workbookFunction · 0.85
clean_dataFunction · 0.70
promptFunction · 0.70

Tested by

no test coverage detected