json_util#
Functions:
|
json.dump "default" argument for sending objects over a JSON API. |
|
Recursively encode any object for transmission through the API. |
|
json.dump "object_hook" argument for receiving JSON from an API request. |
|
Encode bytes as a JSON-serializeable object |
|
Decode a serialized numpy array. |
|
Encode a numpy array a JSON-serializeable object. |
- api_default(obj: Any) Any#
json.dump “default” argument for sending objects over a JSON API. Ensures that special non-JSON types such as Path are NDArray are encoded correctly.
- api_encode(obj: Any)#
Recursively encode any object for transmission through the API.
- api_object_hook(dct: Mapping[str, Any])#
json.dump “object_hook” argument for receiving JSON from an API request. Ensures that special objects that are actually encoded numpy arrays or bytes are decoded as such.
- binary_to_json(binary: bytes)#
Encode bytes as a JSON-serializeable object
- ndarray_from_json(dct: Mapping[str, Any])#
Decode a serialized numpy array.
- ndarray_to_json(arr: ndarray)#
Encode a numpy array a JSON-serializeable object.