I'm moving from R to Python and looking for a workflow similar to R Markdown or knitr for producing clean, polished HTML reports. I'd especially like support for interactive elements such as tabs, flexible layout and formatting options, and the ability to customize the final presentation. What tools or libraries would you recommend?
3 Answers
If you want to build the HTML more directly, Jinja2 is a strong option for templating. You can define an HTML layout with placeholders, then fill it with results, tables, and charts generated by Python. It takes more setup than a notebook-style tool, but gives you a lot of control over the final design.
Quarto is probably the closest match. It evolved from the R Markdown ecosystem but works very well with Python, letting you combine code, narrative text, tables, plots, tabs, and custom formatting in one document. Pairing it with a compatible editor can make the workflow feel quite similar to working in R.
Tabs, flexible formatting, and customization are the main features I’m looking for, so Quarto sounds promising.
For a programmatic approach, you can generate tables with pandas’ to_html() method and use a library such as Dominate to construct the surrounding HTML document. Pandas styling tools are also useful when you want the tables to look more polished without writing all the CSS yourself.

Quarto combined with Positron has worked especially well for me because it provides a comfortable workflow for both R and Python.