Try to use Python's built-in json module.