koala icon indicating copy to clipboard operation
koala copied to clipboard

add to_xlsx function

Open charlesdwright opened this issue 2 years ago • 1 comments

Dumps sheets, cells and formulae from graph to xlsx Todo: handle ranges, test with larger & more complex sheets, ?

Specific case:

‘’’Create workbook and spreadsheet instance’’’
>>> from koala.ExcelCompiler import ExcelCompiler
>>> from koala.Spreadsheet import Spreadsheet
>>> sp_scratch = Spreadsheet()

‘’’Create graph manually per docs”
>>> sp_scratch.cell_add('Sheet1!A1', value=1)
>>> sp_scratch.cell_add('Sheet1!A2', value=2)
>>> sp_scratch.cell_add('Sheet1!A3', formula='=SUM(Sheet1!A1, Sheet1!A2)')

>>> sp_scratch.cell_add('Sheet2!A4', value=1)
>>> sp_scratch.cell_add('Sheet2!A5', value=2)
>>> sp_scratch.cell_add('Sheet2!A6', formula='=SUM(Sheet2!A4, Sheet2!A5)')

‘’’Dump graph to .xlsx’’’
>>> sp_scratch.to_xlsx('blah')

Screen Shot 2022-06-11 at 7 00 57 PM Screen Shot 2022-06-11 at 7 01 05 PM

charlesdwright avatar Jun 11 '22 22:06 charlesdwright

It's now called "to_excel()" and supports output of named ranges.

charlesdwright avatar Jun 27 '22 21:06 charlesdwright