For the idea behind it, we took this list , and dealt with each dictionary alone , we turned it to a string so we can manipulate it.
Next we're recreating the dictionary, by defining the key and the item foe each step:
so as an example:
list_dict1 = '[{reason: NA, employeeName: bob smith}, {reason: NA, employeName: tom jones}]'
result=[]
# Converting string to list
list_dict2 = list_dict1.strip('][').split(', ')
# => it converts string representation of list to a list
for i in list_dict2:
# we loop on each inner "dictionary" rep
s=str(i)# so we can use strip and split methods
d = dict([
(x.split(':')[0].strip(), x.split(':')[1].strip("' "))
for x in s.strip("{}").split(',')
])
# for each x that represents key:item, cs we deleted {} and we split
them based on ","
# Next we defined the key as being the first item , if we split using
# ":", and so on
result.append(d)
# we're appending each new dictionary created to our result list
result