Python script to index files in a sqlite database