input = '{key1 value1} {key2 value2} {key3 {value with spaces}}'
x = input.split('} {')
y = [i.split(' {') for i in y]
z = [[i.translate(None, '{').translate(None, '}').split() for i in j] for j in
    y]
fin = {}
for i in z:
    fin[i[0][0]] = i[-1]
Turning string with embedded brackets into a dictionary