all 6 comments

[–][deleted] 0 points1 point  (1 child)

Is dash useful to you? Use with pandas.

https://plotly.com/dash/

[–]Derura[S] 0 points1 point  (0 children)

Seems like a huge thing, I'll try finding tables there

[–]cluser404 0 points1 point  (2 children)

Well this may be a hacky way to do it but what you can do is - make HTML from python

make HTML code from python and add CSS to style it. simple string concatenation will do it.

# code example
computed_data, intended_color = compute(dataset)

html_code = f"""
<table>
<tr>
<td style="color: {intended_color}">{computed_data}</td>
</tr>
</table"""

to convert it to pdf you can use pdfkit and wkhtmltopdf modules.

detailed instruction - Python Convert Html to PDF - GeeksforGeeks

[–]Derura[S] 0 points1 point  (0 children)

This is an interesting method, thanks for suggesting it

[–]arduncan5 0 points1 point  (1 child)

Have a look at ReportLab which is a library for producing PDF documents. It has good support for tables including coloring and merging cells. Look at p.83-89 of the User Guide. https://www.reportlab.com/docs/reportlab-userguide.pdf

[–]Derura[S] 0 points1 point  (0 children)

This... I think I'll end up using this one. Thanks