tags:

views:

82

answers:

2

I need to create Excel XML files from Python.

The Excel XML format is fairly simple. I looked at a a sample xml file saved from Excel 2003 and it is fairly simple.

I'm looking for a a Pythonic, ready made library to create such xml files instead of reinventing one.

Something that 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")

Anybody know of something like that?

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

A: 

If you are on windows with Excel installed, you could look into Excel Automation.

from win32com import client
excel_app = client.Dispatch("Excel.Application")
# check VBA documentation on automating excel...
Daren Thomas
Good idea, but I may not have Excel installed.
Ayman
+1  A: 

give pythonOffice a try

Nikolaus Gradwohl
Looks promising. But seems a bit outdated.
Ayman