How it works...

First, we import the required libraries to handle argument parsing, creating counts of objects, and copying files:

from __future__ import print_functionimport argparsefrom collections import Counterimport shutilimport osimport sys

This recipe's command-line handler takes one positional argument, OUTPUT_DIR, which represents the desired output path for the HTML dashboard. After checking whether the directory exists, and creating it if it doesn't, we call the main() function and pass the output directory to it:

if __name__ == "__main__":    # Command-line Argument Parser    parser = argparse.ArgumentParser(        description=__description__,        epilog="Developed by {} on {}".format(            ", ".join(__authors__), __date__)    ) parser.add_argument("OUTPUT_DIR", ...

Get Python Digital Forensics Cookbook now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.