PycodeSerializer#

class xsdata.formats.dataclass.serializers.PycodeSerializer(config=<factory>, context=<factory>)[source]#

Pycode serializer for dataclasses.

Return a python representation code of a model instance.

Parameters:
render(obj, var_name='obj')[source]#

Convert and return the given object tree as python representation code.

Parameters:
  • obj (object) – The input dataclass instance

  • var_name (str) – The var name to assign the model instance

Return type:

str

write(out, obj, var_name)[source]#

Write the given object tree to the output text stream.

Parameters:
  • out (TextIO) – The output stream

  • obj (Any) – The input dataclass instance

  • var_name (str) – The var name to assign the model instance

__eq__(other)#

Return self==value.

__hash__ = None#