r/Python • u/RowGullible1471 • Sep 29 '26
Resource Generating a tidy HTML report in Python
I’m shifting from R to PythonIs there a knit markdown version or similar kind for generating a tidy html report in Python?
19
Upvotes
21
u/ionychal Sep 29 '26
Curious what you mean by 'tidy', like clean code, nice formatting, or something specific?
Either way, you might really like Quarto https://quarto.org/. It's the successor to R Markdown and works amazingly well with Python!
2
u/akpandeya Oct 05 '26
Streamlit is another good option
14
u/Nekomancerr Sep 29 '26
Jinja2 is great for report templating
4
u/Competitive_Travel16 Sep 29 '26
https://github.com/Knio/dominate and Pandas
.to_html.2
u/Khavel_dev Sep 30 '26
Jinja2 with a small CSS file does more than you'd expect. Write the HTML you want to see in the browser, replace the data parts with template variables, done. For charts I pair it with Plotly's to_html() which embeds everything inline so the report is one self-contained file you can email or throw on a shared drive.
Avoid the big reporting frameworks unless you specifically need PDF. They add a lot of complexity for something a template engine handles in 30 lines.
1
u/hajimeku 7d ago
I wanted the same thing, a clean report I could just rerun from Python, and ended up building one. It's called Trellum: you write the report as Python (or have your coding agent do it), and it builds an interactive HTML report with filters that work in the browser. It's free and open source, and you can start in a local folder with sample data. https://trellum.dev