<filename>ast/ast-string2dict.py
#!/usr/bin/python
# -*- coding: utf-8 -*-

import ast


data = "{'key': 'value'}"
print(type(data))

data = ast.literal_eval(data)
print(type(data))
<filename>ast/ast-string2dict.py
#!/usr/bin/python
# -*- coding: utf-8 -*-

import ast


data = "{'key': 'value'}"
print(type(data))

data = ast.literal_eval(data)
print(type(data))
#!/usr/bin/python # -*- coding: utf-8 -*-