First, we import the required libraries to handle argument parsing, parsing dates, and the html_dashboard script we created in the previous recipe:
from __future__ import print_functionimport argparsefrom datetime import datetimeimport osimport sysimport html_dashboard
This recipe's command-line handler takes two positional arguments, INPUT_DIR and OUTPUT_DIR, which represent the path to the directory containing acquisition logs and the desired output path, respectively. After creating the output directory, if necessary, and validating that the input directory exists, we call the main() method and pass these two variables to it:
if __name__ == "__main__": # Command-line Argument Parser parser = argparse.ArgumentParser( description=__description__, ...