`json.loads()` is the way to go, but if you’re working with messy data, you might wanna preprocess the string.
For example, sometimes APIs return JSON with trailing commas or comments—`json.loads()` will choke on those. Tools like `demjson` (third-party) can handle some non-standard JSON, but it’s slower.
Stick with `json.loads()` for most cases, though.
For example, sometimes APIs return JSON with trailing commas or comments—`json.loads()` will choke on those. Tools like `demjson` (third-party) can handle some non-standard JSON, but it’s slower.
Stick with `json.loads()` for most cases, though.
