Which library should I use to write an XLS from Linux / Python?

て烟熏妆下的殇ゞ 提交于 2019-12-03 07:15:20
S.Lott

What's wrong with xlwt?

+1 for xlwt. See Matt Harrison's blog for posts on how to use xlwt and how to deal with large spreadsheets. Also, check out the python-excel group on Google "If you use Python to read, write or otherwise manipulate Excel files".

I'd use JExcelApi, but only because I've used it before. Never have touched HSSF. Biggest show-stopper I can recall is JExcelApi doesn't support multiple formats in one cell (e.g. half the text in bold, the other half in italic or something like that). I think in general JExcelApi is more limited than HSSF, but the limitations never got in my way.

And yes, documentation is sparse for the interface (and nonexistent for the underlying mechanisms), but I thought it was doable...

i personally dis-advise JExcel if you intent to use anything more then very simple text to excel and vice versa.

the more advanced features are abstracted very leaky from the underlying (basically undocumented) low-level code / (documented) Excel specs.

another problem we ran into is jexcel fails fatally when encountering invalid formulas. and if you need to parse client supplied spreadsheets this is a problem.

also the new POI version support (almost) seemless both xls and xlsx at the same time.

Excel exposes the same OLE automation API used by VBA to anything that supports COM. You can use win32com (which is included with ActiveState Python by default) to manipulate spreadsheets in much the same way that you would do in VBA.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!