Live data from Hacker News

Use Python in Excel without add-ins

xlwings.org

1–10 of 73 posts

Re: Use Python in Excel without add-ins

#2
Not the same thing, but this made me think about it and readers might be interested to know that the xlrd, xlwt and xlutils python modules (http://www.python-excel.org/) allow you to manipulate Excel files in Python, without even having Excel installed (it's pure Python, so it also works on Linux, for example).

Re: Use Python in Excel without add-ins

#4

Not the same thing, but this made me think about it and readers might be interested to know that the xlrd, xlwt and xlutils python modules ( http://www.python-excel.org/ ) allow you to manipulate Excel files in Python, without even having Excel installed (it's pure Python, so it also works on Linux, for example).

Looks like xlrd may have been updated to read newer formats, but xlwt is still limited and cannot write .xlsx format spreadsheets, for example. openpyxl _can_ handle the newer formats, but only the newer formats.

It's a bit of a mess.

Re: Use Python in Excel without add-ins

#5
post #4

Not the same thing, but this made me think about it and readers might be interested to know that the xlrd, xlwt and xlutils python modules ( http://www.python-excel.org/ ) allow you to manipulate Excel files in Python, without even having Excel installed (it's pure Python, so it also works on Linux, for example).

Looks like xlrd may have been updated to read newer formats, but xlwt is still limited and cannot write .xlsx format spreadsheets, for example. openpyxl _can_ handle the newer formats, but only the newer formats. It's a bit of a mess.

Working with Excel spreadsheets in general is a mess. There really isn't a single library that does everything well and if you want of be able to get all the information like formatting, formulas, etc... the only really complete solution is to use pywin32 and com which requires Excel and isn't particularly fast or easy either.

Re: Use Python in Excel without add-ins

#6
This is fantastic - I am going to start testing it now. I write a fair amount of VB macros, and would much prefer to be able to use Python.

And, if they could create a plugin that allowed Libre Office to do the same, they could solve one of the last remaining major interoperability issues with LO and Excel: the inability to run VB macros in LO. That would be huge.

Re: Use Python in Excel without add-ins

#7
post #4

Not the same thing, but this made me think about it and readers might be interested to know that the xlrd, xlwt and xlutils python modules ( http://www.python-excel.org/ ) allow you to manipulate Excel files in Python, without even having Excel installed (it's pure Python, so it also works on Linux, for example).

Looks like xlrd may have been updated to read newer formats, but xlwt is still limited and cannot write .xlsx format spreadsheets, for example. openpyxl _can_ handle the newer formats, but only the newer formats. It's a bit of a mess.

xlsx: https://xlsxwriter.readthedocs.org/ powerpoint: http://python-pptx.readthedocs.org/en/latest/ word: https://pypi.python.org/pypi/docx/0.2.4
Post reply on HN