Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create an html formatted report

I have a Python 2.6 app running on Linux that creates a CSV file. From the app, I need to create an HTML report, as a single HTML file, that presents the data from the CSV (probably as a table) and also highlights fields where the values meet certain criteria. Charting type functionality would be a nice to have.

What's the best way to do this?

No GPL stuff please.

like image 848
VacuumTube Avatar asked Jan 26 '11 12:01

VacuumTube


1 Answers

Choose a Python csv library from here. Now that you have the data mapped to Python data structures you can iterate on it and create the html. I would use the Jinja2 templating engine which is nicely documented. Highlighting rows/cells would work by setting certain css classes on the respective tr/td elements in the table.

like image 97
chris Avatar answered Oct 14 '22 04:10

chris