Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I'd love a good native Python library to write XLS, but it doesn't seem to exist. Happily, Jython does.

So I'm trying to decide between jexcelapi and Apache HSSF: http://www.andykhan.com/jexcelapi/tutorial.html#writing http://poi.apache.org/hssf/quick-guide.html

(I can't use COM automation because I'm not on Windows, and even if I was, I couldn't afford Office licenses.)

My initial thoughts are that POI/HSSF is very thorough, but also very Java-- everything seems a bit harder than it needs to be. Good documentation, but my head hurts trying to bridge the gap between what it describes and what I need to accomplish.

jexcepapi seems to have a simpler, nicer (for me) interface, but doesn't have very good documentation or community.

Which would you use, and why?

like image 280
Jeremy Dunck Avatar asked Oct 28 '08 23:10

Jeremy Dunck


People also ask

Which Python library is used for Excel?

Openpyxl is a Python library that is used to read from an Excel file or write to an Excel file. Data scientists use Openpyxl for data analysis, data copying, data mining, drawing charts, styling sheets, adding formulas, and more. Workbook: A spreadsheet is represented as a workbook in openpyxl.

Which is better XlsxWriter or openpyxl?

XlsxWriter. If you only need to write Excel workbooks and not read them then XlsxWriter is an easy to use package to use that works well. If you are working with large files or are particularly concerned about speed then you may find XlsxWriter a better choice than OpenPyXL.


2 Answers

What's wrong with xlwt?

like image 77
S.Lott Avatar answered Sep 19 '22 12:09

S.Lott


+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".

like image 41
technomalogical Avatar answered Sep 21 '22 12:09

technomalogical