3

I have some data in CSV format that I want to pull into an Excel spreadsheet and then create some standard set of graphs for. Since the data is originally generated in a Python app, I was hoping to simply extend the app so that it could do all the post processing and I wouldn't have to do it by hand. Is there an easy interface with Python to work with and manipulate Excel spreadsheets? Any good samples of doing this? Is this Windows only (I'm primarily working on a Mac and have Excel, but could do this on Windows if necessary).

Tim
  • 6,851
  • 11
  • 42
  • 46

2 Answers2

7

xlutils (and the included packages xlrd and xlwt) should allow your Python program to handily do any creation, reading and manipulation of Excel files you might want!

Alex Martelli
  • 854,459
  • 170
  • 1,222
  • 1,395
1

On Windows you could use the pywin32 package to create an Excel COM Object and then manipulate it from a script. You need to have an installed Excel on that machine though. I haven't done this myself so I can't give you and details but I've seen this working so can at least confirm that it's possible. No idea about OS X, unfortunately.

bluebrother
  • 8,636
  • 1
  • 20
  • 21