Moving on to our writers

Within the writers directory, we have two scripts: csv_writer.py and kml_writer.py. Both of these writers are called depending on the types of data being processed in the metadata_parser.py framework.

Writing spreadsheets – csv_writer.py

In this chapter, we will use the csv.DictWriter instead of csv.Writer just as in Chapter 5, Databases in Python, and Chapter 6, Extracting Artifacts from Binary Files. As a reminder, the difference is that the DictWriter writes dictionary objects to a CSV file and the csv.Writer function is more suited for writing lists.

The great thing about the csv.DictWriter is that it requires an argument, fieldnames, when creating the writer object. The fieldnames argument should be a list that represents ...

Get Learning Python for Forensics now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.