The Train status API I use recently added two additional key value pairs (has_arrived, has_departed) in the JSON object, which caused my script to crash.
(has_arrived, has_departed)
json.loads cant parse the pythons boolean type (False, True). Json wants to have small letters false, true
my solution:
python_json_string.replace(": True,", ": true,").replace(": False,", ": false,")