mapry.py.generate

Generate the Python code to parse and serialize a mapry object graph.

mapry.py.generate.types

mapry.py.generate.parse

Generate the code that defines general structures required for parsing.

mapry.py.generate.parse.generate(graph, py)

Generate the source file to define general structures required for parsing.

Parameters
  • graph (Graph) – mapry definition of the object graph

  • py (Py) – Python settings

Return type

str

Returns

content of the source file

Ensures
  • result.endswith('\n')

mapry.py.generate.fromjsonable

mapry.py.generate.tojsonable

Generate the code that serializes the object graph to a JSONable.

mapry.py.generate.tojsonable.generate(graph, py)

Generate the source file to parse an object graph from a JSONable object.

Parameters
  • graph (Graph) – mapry definition of the object graph

  • py (Py) – Python settings

Return type

str

Returns

content of the source file

Ensures
  • result.endswith('\n')