PDF Reports (complete documentation here) is a Python library to create nice-looking PDF reports from HTML or Pug templates. It features modern-looking components (via the Semantic UI framework) and provides routines to embed tables or plots in the documents.
Your Pug template file template.pug
may look like this (see a full example):
#sidebar I am the text in the sidebar.
h1 {{ title }}
.ui.piled.segment
p Oh hi there ! I am some text in a cool box.
Your Python code will be as follows:
from pdf_reports import pug_to_html, write_report
html = pug_to_html("template.pug", title="My report")
write_report(html, "example.pdf")
And your final result may look like this (PDF file):
PIP installation:
pip install pdf_reports
Web documentation:
https://edinburgh-genome-foundry.github.io/pdf_reports/
Github Page:
https://github.com/Edinburgh-Genome-Foundry/pdf_reports
Live demo:
http://cuba.genomefoundry.org/sculpt_a_sequence
License: MIT, Copyright Edinburgh Genome Foundry