Using HTML templates
Recipe Difficulty: Easy
Python Version: 2.7 or 3.5
Operating System: Any
HTML can be an effective medium for a report. There are a great number of snazzy templates out there that can make even technical reports look appealing. That's the first step towards hooking the audience. Or, at the very least, a preventative measure to forestall the audience from instantly nodding off. This recipe uses one such template and some test data to create a visually compelling example of acquisition details. We really have our work cut out for us here.
Getting started
This recipe introduces HTML templating with the jinja2
module. The jinja2
library is a very powerful tool and has a number of different documented features. We will be using it in a rather simple scenario. All other libraries used in this script are present in Python's standard library. We can use pip to install jinja2
:
pip install jinja2==2.9.6
In addition to jinja2
, we will also be using a slightly modified template, called...