Q: Python SQL database parsing with a specific date range I would like to find a method to parse data in SQL database to only include a specified date range. We're working with clock-in/out machine database parsing; and soon it will become unworkable due to the sheer number of entries.
This is my script (written with community's help) to parse data:
for key in dictionary:
    regex = prefix + key
    f.write(dictionary.get(key) + '\n')  # header above each sub-list of clock-in formation
    with open(log_file_path, "r") as file:
        matched_list = re.findall(regex, file.read())  # parsing data from SQL database
        f.write(str(sorted(matched_list)))  # writing to a file
        f.write('\n' + '_' * 50 + '\n')
file.close()

...and the output is a list of entries written to a file under each person's ID:
'createTime: 2020-06-01T15:47:30.412Z\nemployee:\n  _id: id1, 
'createTime: 2020-06-01T19:29:39.708Z\nemployee:\n  _id: id1, 
'createTime: 2020-06-02T06:24:58.022Z\nemployee:\n  _id: id1,

Is there a way to add aditional functionality to allow for easy specification (let's say a string '2020-06-01'-'2020-06-03) to trim or exclude other entries which do not satisfy those dates:
So the entries are only generated in the range of, for instance, 2020-06-01 to 2020-06-03 inclusive.
I've got the script to generate the dates in Python using the datetime module. I thought I could generate a list to check against the each entry, and that didn't seemed to work for me.
Thank you.
