xsdata.formats.dataclass.generator module¶
-
class
xsdata.formats.dataclass.generator.
DataclassGenerator
(config)[source]¶ Bases:
xsdata.formats.mixins.AbstractGenerator
Python dataclasses code generator.
- Parameters
config (
GeneratorConfig
) –
-
render
(classes)[source]¶ Return a iterator of the generated results.
Group classes into modules and yield an output per module and per package __init__.py file.
- Parameters
- Return type
-
render_package
(classes)[source]¶ Render the source code for the __init__.py with all the imports of the generated class names.
-
render_module
(resolver, classes)[source]¶ Render the source code for the target module of the given class list.
- Parameters
resolver (
DependenciesResolver
) –
- Return type
-
classmethod
ensure_packages
(package)[source]¶ Ensure all the __init__ files exists for the target package path, otherwise yield the necessary filepath, name, source output that needs to be crated.
- Parameters
package (
Path
) –- Return type