intermediate_dict = {}
for entry in my_dict:
    line_string, key = entry
line_number = int(line_string[line_string.index('(') + 1:line_string.index(
    ')')])
if line_number not in intermediate_dict:
    intermediate_dict[line_number] = {}
intermediate_dict[line_number][key] = my_dict[entry]
new_list = []
for i in range(len(intermediate_dict)):
    new_list.append(intermediate_dict[i])
Converting flat Python Dictionary to List of Dictionaries