As always, we challenge you to add new features to this script and extend it using the knowledge and available resources that you have. For this chapter, we first challenge you to hash the indexed files using MD5 or SHA1 and store that information in the database. You can use the built-in hashlib library to handle hashing operations; more on this and other hashing techniques in Chapter 7, Fuzzy Hashing.
In addition, consider adding user-specified filters for particular file extensions for the collection. These features can be implemented without major renovation to the code, though you may find it easiest and more beneficial to your understanding to start from scratch and build the script with one or more of these new features in mind.
One more extension that we can add to our code is parsing the file's modes into separate columns for ease of querying in our database...