import shlex
s = 'key1=1234 key2="string with space" key3="SrtingWithoutSpace"'
print(dict(token.split('=') for token in shlex.split(s)))
Creating dictionary from space separated key=value string in Python