Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

python excel making reports

Tags:

python

excel

I've been given the task of connecting my code (fortran) with py (2.5), and generate a number of excel reports if possible. The first part went fine - and is done with, but now I'm working on the second.

What are my choices for making excel (2007 if possible) sheets from python ? In general, I would need to put some array values in them in a table (formatting doesn't matter), and draw a number of charts from those tables. Is there a way to do this automatically ? Some library ?

Anyone done something like this in the past ?

like image 967
Rook Avatar asked Feb 16 '09 11:02

Rook


People also ask

Can Python generate reports?

The good news is, Python can generate reports in all these formats. So you can choose any of these formats, depending on the needs of the report's users. Below is a summary of what we'll cover in this tutorial. We'll need pandas for all the reports, since we need to manipulate and analyze data when building reports.

Can Excel automatically generate reports?

Creating Automated Reports in Excel. Report automation in Excel is all about maximizing productivity and saving time. Report Automation allows you to take a relatively hands-off approach to the report creation and updating process by using software, manual coding, and other technologies.

Can Python write Excel files?

XlsxWriter is a Python module for writing files in the XLSX file format. It can be used to write text, numbers, and formulas to multiple worksheets. Also, it supports features such as formatting, images, charts, page setup, auto filters, conditional formatting and many others.


1 Answers

You're simplest approach is to use Python's csv library to create a simple CSV file. Excel imports these effortlessly.

Then you do Excel stuff to make charts out of the pages created from CSV sheets.

There are some recipes for controlling Excel from within Python. See http://code.activestate.com/recipes/528870/ for an example. The example has references to other projects.

Also, you can use pyExcelerator or xlwt to create a more complete Excel workbook.

like image 146
S.Lott Avatar answered Oct 06 '22 04:10

S.Lott