Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add to_xlsx function #262

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

charlesdwright
Copy link

@charlesdwright charlesdwright commented Jun 11, 2022

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 added 4 commits June 11, 2022 18:49
dumps sheets, cells and formula to xlsx
todo: handle ranges, ?
refact to handle ranges
@charlesdwright
Copy link
Author

charlesdwright commented Jun 27, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant