In this iteration, we will use third-party Python modules to automate our SQL and HTML setup further. This will introduce extra overhead; however, our script will be simpler to implement and more streamlined, which will allow us to easily develop further functionality. Developing with an eye toward the future helps prevent us from rewriting the entire script for every minor feature request.
We have imported the majority of the standard libraries required in the prior version and added the third-party unicodecsv module (version 0.14.1). This module wraps around the built-in csv module and automatically provides Unicode support for the CSV output. To keep things familiar, we can even name it csv by using the import...as... statement on line 8. As mentioned previously in this chapter, peewee (version 2.8.0) and jinja2 (version...