ไม่สามารถเล่นวิดีโอนี้
ขออภัยในความไม่สะดวก
How to generate Reports with Python automatically - 3: HTML (with template) & HTML to PDF
ฝัง
- เผยแพร่เมื่อ 5 ส.ค. 2021
- Welcome to our new Generate Reports with Python automatically series. You'll generate an example report in different formats.
In this Part 3 video, we'll generate reports as HTML (without and with a template), and convert it to PDF.
GitHub Repo with code: github.com/lia...
Part 1: Overview
Part 2: Excel
▶️Part 3: HTML (with template) & HTML to PDF
Part 4: PDF directly
Technologies that will be used
☑️ JupyterLab (Notebook)
☑️ pandas
☑️ Jinja2
☑️ WeasyPrint
☑️ FPDF
Links mentioned in the video
►Jinja (templating engine) syntax: jinja.palletsp...
►Jinja loader: jinja.palletsp...
There's also an article version of the same content. If you prefer reading, please check it out. How to generate Reports with Python (3 Formats/4 Tools): www.justintoda...
Get access to more data science materials, check out our website Just into Data: justintodata.com/
Just wanted to say thanks for this. Nothing else I could find gave me exactly what I was needing for what I'm working on. Thanks and great work!
Glad we can help! Thank you for watching too.
Wonderful !
Next content idea.
FastApi!
Database into web crud app using FastAPI and jinja templates
Liked and subscribed!
Thank you for this nice video.
Great explanation! How to improve the table design?
Thanks, Ariel. You can improve by changing HTML settings.
How do I generate a table with sum values in python? Thanks.
Nice content. Leant a lot. Just wondering how to generate python html report with the interactive plot which is clickable like plotly plot. Cheers
Hi Ethan, it's going to be a lot more work. You probably should export the plotly chart as svg, and then try to embed that in html report. Also need to import plotly js library into html file.
@@justintodata Thanks for your suggestion
You can do this using plotly: fig.write_html("path/to/file.html"). Search "Interactive HTML Export in Python" for the doc on plotly's website. There are some additional settings you can use to slim the file down if you have an internet connection. I'm using that for viewing individual plots in an html file, but haven't figured out how to combine these interactive plots with other content (headings, lists, tables, other figures, etc.). You might be able to study the layout of the plotly-generated files and reproduce it in a template form like this video though. That's what I'm currently working on figuring out how to do...