In Python, how can I convert a string object that looks like this
"{
apartment=false,
walls=[{min_height=18, max_height=3, color=WHITE}],
appliances=[{type=[oven, washing_machine, microwave, drying_machine,
dish_washer, television]}],
rooms=[{bathroom=true, floor=2}, {bedroom=true, floor=[2,3], needs_renovation=EXCLUDE}],
value=[{sale_price=9003.01, occupied=true, family_unit=UNKNOWN}]
}"
To a dictionary object like this?
{
"apartment": False,
"walls": [{"min_height": 18, "max_height": 3, "color": "WHITE"}],
"appliances": [{"type": ["oven", "washing_machine", "microwave", "drying_machine",
"dish_washer", "television"]}],
"rooms": [{"bathroom": True, "floor": 2}, {"bedroom": True, "floor":[2,3], "needs_renovation": "EXCLUDE"}],
"value": [{"sale_price": 9003.01, "occupied": True, "family_unit": "UNKNOWN"}]
}
I was using Simple way to convert a string to a dictionary, but it didn't get me far enough because I couldn't handle the nested dictionaries and lists.