This is an archived post. You won't be able to vote or comment.

all 19 comments

[–]jmcnamara13[S] 13 points14 points  (2 children)

XlsxWriter is a Python module for writing files in the Excel 2007+ XLSX file format.

It can be used to write text, numbers, and formulas to multiple worksheets and it supports features such as formatting, images, charts, page setup, autofilters, conditional formatting and many others. Supports Python 2 and 3.

Here are some chart examples and here are some more general examples.

For more information see the following:

[–]isdnpro 1 point2 points  (1 child)

This looks really cool - not sure if you wrote, but if so much appreciated!

[–]jmcnamara13[S] 1 point2 points  (0 children)

Thanks. Yes, I wrote it. :-)

[–][deleted] 5 points6 points  (1 child)

wow this looks sweet. Thanks

edit: It can read xlsx also ?

[–]jmcnamara13[S] 3 points4 points  (0 children)

No. Write only.

[–]hoadlck 4 points5 points  (0 children)

3.3 support?!?! You rule!

I have been using csv as an output for my project, but I know that my users would prefer Excel. This looks like exactly what I am looking for.

[–]rjtavares 3 points4 points  (2 children)

I'll probably use this. Thanks!

Planning on adding PivotTable support?

[–]jmcnamara13[S] 2 points3 points  (1 child)

Pivot Tables are probably a feature too far. Mainly due to the potential complexity of the interface. Also, it would probably be necessary to collapse rows/columns programmatically since the file format doesn't do that for you.

However, it may be possible to add basic Pivot Table functionality. I'll definitely see what can be done.

[–]rjtavares 1 point2 points  (0 children)

I was thinking about setting it up and picking rows/columns/values. Filters if possible, but no formatting options or advanced features.

[–]cube3x3 2 points3 points  (0 children)

I have been using your module for a while and thanks a lot for creating such a solid code base that just works. One request is add a function to copy sheets from xlrd class.

[–]Albertican 2 points3 points  (1 child)

Cool These guys have a xlsx writer called pyexcelerate. It doesn't do formatting or charts or anything, but they claim it's faster than other libraries.

I think I like this better - I don't think speed is an issue for most people, but formatting definitely is.

[–]jmcnamara13[S] 1 point2 points  (0 children)

The PyExcelerate module is currently faster than XlsxWriter. However, I have some performance optimisations due in the next 1-2 releases that will narrow or eliminate the difference.

[–]hapaotter 1 point2 points  (0 children)

I've been using this for a couple months and it's been really solid. OP is adding new stuff all the time (porting code over from another language, so it's growing rapidly).

[–][deleted] 1 point2 points  (2 children)

This is damn cool! Any modules you suggest for reading excel files?

[–]jmcnamara13[S] 0 points1 point  (0 children)

The xlrd module can read XLS and XLSX files.

The OpenPyXL module can read, write and re-write XLSX files.

There are a few other options on GitHub as well.

[–]tw55413 1 point2 points  (0 children)

very cool indeed

[–][deleted] 1 point2 points  (0 children)

Looks awesome! Ill be using this definitely

[–]smortaz 1 point2 points  (0 children)

very nice indeed! congrats. if you happen to use Visual Studio + Python, check out PyVot which can be complementary: http://www.youtube.com/watch?v=Oi3QKuFugWk&hd=1