Creating Excel XML Files from Python

I need to create Excel XML files from Python.

The Excel XML format is pretty simple. I looked at a sample XML file saved in Excel 2003, and it is quite simple.

I am looking for a ready-made Pythonic library for creating such XML files instead of reinventing them.

Something I can use as below:

book = Expy.Workbook() s1 = book.add_sheet() s1[0, 2] = "A3" s1[0, 0] = 12 s1[0, 9] = Expy.Formula("=Sum(A1:A3)") book.write("excelfile.xml") 

Does anyone know something like this?

xlwt seems deprecated, supporting only python 2.x and seems to write xls files, not xml.

+4
source share
3 answers
+3
source

If you are running Windows with Excel installed, you can look in Excel Automation.

 from win32com import client excel_app = client.Dispatch("Excel.Application") # check VBA documentation on automating excel... 
+1
source

xlwt will write Excel files from python, but I'm not sure if it handles the newer XML file formats. http://pypi.python.org/pypi/xlwt

+1
source

All Articles