titus.datatype.jsonEncoder

titus.datatype.jsonEncoder(avroType, value, tagged=True)[source]

Encode an object as JSON, given titus.datatype.AvroType.

Parameters:
  • avroType (titus.datatype.AvroType) – type of this object
  • value (dicts, lists, strings, numbers, True, False, None) – the object returned from PFAEngine.action
  • tagged (bool) – if True, represent unions as {tag: value}; if False, represent them simply as value.
Return type:

dicts, lists, strings, numbers, True, False, None

Returns:

the JSON object in Python encoding