I want to parse a string of JSON back into a JSON. the string has some boolean values.
Example input:
str_json = "{'name': 'bob', 'id': '11111', 'happy': True, 'sad': False}"
Example output:
d = {"name": "bob", "id": "11111", "happy": "True", "sad": "False"}
I've tried this:
p = re.compile('(?<!\\\\)\'')
str_json = p.sub('\"', str_json)
d = json.loads(str_json)
and got this exception:
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 91 (char 90)