import os import hashlib from glob import glob from pathlib import Path import json if __name__ == '__main__': data_sums = json.loads(Path('dataSums.json').read_text()) data_sums_new = json.loads(Path('dataSums.new.json').read_text()) for file in data_sums: try: if (data_sums[file] != data_sums_new[file]): print('{file} updated.'.format(file=file)) except KeyError as e: print('{file} added.'.format(file=file))