Python ofrece json.loads y json.dumps.
import json data = json.loads(text)
text = json.dumps(data, indent=2)
try: json.loads(text) except json.JSONDecodeError as error: print(error)