xsdata.formats.dataclass.generator module

class xsdata.formats.dataclass.generator.DataclassGenerator[source]

Bases: xsdata.formats.generators.PythonAbstractGenerator

templates_dir: Optional[pathlib.Path] = PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/xsdata/envs/v20.4/lib/python3.7/site-packages/xsdata/formats/dataclass/templates')
render_module(output, imports)[source]
Return type

str

render_class(obj)[source]
Return type

str

render(classes)[source]

Given a list of classes return to the writer factory the target file path full module path and the rendered code.

Return type

Iterator[Tuple[Path, str, str]]

render_classes(classes)[source]

Get a list of sorted classes from the imports resolver, apply the python code conventions and return the rendered output.

Return type

str

prepare_classes(classes)[source]
prepare_imports(imports)[source]

Get a list of sorted packages from the imports resolver apply the python code conventions, group them by the source package and return them.

Return type

Dict[str, List[Package]]