xsdata.formats.dataclass.generator module

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

Bases: xsdata.generators.PythonAbstractGenerator

templates_dir: Optional[pathlib.Path] = PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/xsdata/envs/v20.1.1/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(schema, classes, package)[source]

Given a schema, a list of classes and a target package return to the writer factory the target file path and the rendered code.

Return type

Iterator[Tuple[Path, str]]

render_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()[source]
prepare_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]]