So I used json.dumps and json.loads but the output was not a valid JSON.
I understand that JSON needs double quotes instead of simple quotes, but I don't think that the solution is to search and replace is the best way to resolve this problem.
Is there a more proper way to do it ?