Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to generate formatted pdf or eps table using Python?

I typically have some data from a simulation that I would like to include in a presentation in the form of a table. Usually I use Open(Libre)-Office Impress for doing my presentation. I then copy-paste from my results to the Impress table. I find this a bit tedious. Since I've already got the results in Python, is there any way I can auto-generate a .pdf or .eps table from these data so that I can just quickly import the .pdf or .eps to Impress?

like image 446
Viktiglemma Avatar asked May 29 '11 17:05

Viktiglemma


2 Answers

<plug>I wrote TableFactory to do this for my websites.</plug> It's a wrapper around ReportLab (at least, the PDF generator class is). You can see some example code and output at http://kstrauser.github.com/tablefactory/ .

like image 103
Kirk Strauser Avatar answered Nov 17 '22 14:11

Kirk Strauser


The standard way of doing this in Python is ReportLab but installing it, is not so easy nor using it.

I don't know exactly what requirements do have but an workaround would be to generate HTML reports and to convert them to PDF.

Depending on what platform you use, you may have different approaches. For example for OSX is really easy, /System/Library/Printers/Libraries/convert

like image 31
sorin Avatar answered Nov 17 '22 14:11

sorin