开发者

Create an html formatted report

开发者 https://www.devze.com 2023-02-06 16:04 出处:网络
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 al

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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消