I am extracting a postgres table as json. The output file contains lines like:
{\"data\": {\"test\": 1, \"hello\": \"I have \\\" !\"}, \"id\": 4}
Try this:
json.loads(r'{"data": {"test": 1, "hello": "I have \" !"}, "id": 4}')
If you have that string inside a variable, then just:
json.loads(data.replace("\\", r"\\"))
Hope it helps!