6.11. boing.net.json — JSON encoding

The module boing.net.json provides methods and classes for supporting JSON object serialization. It uses the python json standard module, but it provides a default solution for serializing bytestrings and datetime.datetime objects.

Encoder and Decoder classes provide a standard interface for the JSON encoding.

boing.net.json.encode(obj)

Return a string containing the json serialization of obj.

boing.net.json.decode(string)

Return the object obtained for decoding string using the JSON decoding.

class boing.net.json.Encoder

The Encoder is able to serialize standard data types into json strings.

encode(obj)

Return a string containing the json serialization of obj.

reset()

NOP method.

class boing.net.json.Decoder

The Decoder object is able to decode json strings into the corrispetive python objects.

decode(string)

Return the list of object obtained from the deserialization of string.

reset()

NOP method.

Previous topic

6.10. boing.net.slip — SLIP encoding

Next topic

6.12. boing.net.osc — OSC encoding