Referring on this question, I have a similar -but not the same- problem..
On my way, I\'ll have some text file, structured like:
var_a: \'home\'
var_
Load your file with JSON or PyYAML into a dictionary the_dict (see doc for JSON or PyYAML for this step, both can store data type) and add the dictionary to your globals dictionary, e.g. using globals().update(the_dict).
If you want it in a local dictionary instead (e.g. inside a function), you can do it like this:
for (n, v) in the_dict.items():
exec('%s=%s' % (n, repr(v)))
as long as it is safe to use exec. If not, you can use the dictionary directly.