Protocol decode

class wishbone.protocol.Decode[source]
class wishbone.protocol.decode.plain.Plain(charset='utf-8', delimiter=None, buffer_size=4096, strip_newline=False)[source]

Decode string data into a Python object.

Parameters:
  • charset (-) –
    The charset to use when decoding.
  • delimiter (-) –
    The dilimiter to use in a stream of Python docs.
    None expects the complete payload to be 1 json document.
  • buffer_size (-) –
    The maximum number of bytes allowed to buffer.
  • strip_newline (-) –
    If True strips newline from each line.
class wishbone.protocol.decode.json.JSON(charset='utf-8', delimiter=None, buffer_size=4096)[source]

Decode a JSON string into a Python object.

Parameters:
  • charset (-) –
    The charset to use when decoding.
  • delimiter (-) –
    The dilimiter to use in a stream of Python docs.
    None expects the complete payload to be 1 json document.
  • buffer_size (-) –
    The maximum number of bytes allowed to buffer.
class wishbone.protocol.decode.msgpack.MSGPack(charset='utf-8', buffer_size=4096)[source]

Decode MSGpack data into a Python data structure.

Convert a MSGPack bytestring into a Python data structure using the defined charset.

Parameters:
  • charset (-) –
    The charset to use to decode the bytestring data.
  • buffer_size (-) –
    The max amount of bytes allowed to read for 1 event