Decode a JSON string to an object. NOTE: For Polygraphy objects, you should use the ``from_json()`` method instead. Args: src (str): The JSON representation of the object Returns: object: The decoded instance
(src)
| 265 | @mod.export() |
| 266 | @try_register_common_json |
| 267 | def from_json(src): |
| 268 | """ |
| 269 | Decode a JSON string to an object. |
| 270 | |
| 271 | NOTE: For Polygraphy objects, you should use the ``from_json()`` method instead. |
| 272 | |
| 273 | Args: |
| 274 | src (str): |
| 275 | The JSON representation of the object |
| 276 | |
| 277 | Returns: |
| 278 | object: The decoded instance |
| 279 | """ |
| 280 | return json.loads(src, object_pairs_hook=Decoder()) |
| 281 | |
| 282 | |
| 283 | @mod.export() |