Skip to content

ZipReport

Welcome to ZipReport documentation

Tests pypi license

ZipReport is a python library to aid the generation of visually appealing PDF documents from HTML templates. It combines Jinja2 template capabilities with PDF generation powered by a headless Chromium browser daemon. By leveraging the browser rendering capabilities, it is possible to use CSS and JS for composition of the document, just as if it was any other web page. Available polyfills such as paged.js can be used to generate headers, footers, page numbers, chapter numbers and even table of contents. It is also possible to generate graphics using popular JS libraries, such as d3js, or even embed runtime-generated graphics generated via Python functions.

Features

  • Design reports in HTML using Jinja templates;
  • Reports are packaged on a single file for easy reuse/distribution;
  • Pluggable rendering backends;
  • Full support for CSS3 and client-side Javascript (when using zipreport-server);
  • Page numbers, headers, footers, ToC, etc. via polyfills (using paged.js);
  • Jinja tags for dynamic image generation in Python;
  • CLI utility to aid development and packaging of reports;
  • MIME multipart email message generation (with all local resources embedded on a single message);

ZipReport Samples

Available samples:

PagedJS Examples:

Example Description Output
pagedjs Basic PagedJS with matplotlib graphics and radar charts PDF
executive_report Modern executive report with KPIs, charts, and TOC PDF
product_brochure Software product brochure with pricing and testimonials PDF
analytics_dashboard Single-page site analytics dashboard (A4 landscape) PDF