In the first iteration of the script, we use several standard libraries to complete all of the functionality required for the full operation. As seen in prior scripts, we are implementing argparse
, csv
and logging
for their usual purposes, which include argument handling, writing CSV reports, and logging program execution. We have imported the sqlite3
module to handle all database operations. Unlike our next iteration, we will only be able to support sqlite3 databases through this script. The os
module allows us to recursively step through files in a directory and any subdirectories. Finally, the sys
module allows us to gather logging information about the system, and the datetime
module is used to format timestamps as we encounter them on the system. This script does not require any third-party libraries. We have the following code:
001 import os 002 import sys 003 import logging 004 import csv 005 import sqlite3 006 import argparse...