xsdata.generators module¶
-
class
xsdata.generators.
AbstractGenerator
[source]¶ Bases:
abc.ABC
-
templates_dir
: Optional[pathlib.Path] = None¶
-
-
class
xsdata.generators.
PythonAbstractGenerator
[source]¶ Bases:
xsdata.generators.AbstractGenerator
,abc.ABC
-
classmethod
process_class
(obj, parents=None)[source]¶ Normalize all class instance fields, extends, name and the inner classes recursively.
- Return type
-
classmethod
process_attribute
(attr, parents)[source]¶ Normalize attribute properties.
- Return type
None
-
classmethod
process_enumeration
(attr, parent)[source]¶ Normalize enumeration properties.
- Return type
None
-
classmethod
type_name
(name)[source]¶ Convert xsd types to python or apply class name conventions after stripping any reference prefix.
- Return type
-
classmethod
attribute_name
(name)[source]¶ Strip reference prefix and turn to snake case.
If the name is one of the python reserved words append the prefix _value
- Return type
-
classmethod
enumeration_name
(name)[source]¶ Strip reference prefix and turn to snake case.
If the name is one of the python reserved words append the prefix _value
- Return type
-
classmethod
attribute_type
(attr, parents)[source]¶ Normalize attribute type.
- Steps:
If type alias is present use class name normalization
Otherwise use the type name normalization
Prepend outer class names and quote result for forward references
Wrap the result with List if the field accepts a list of values
Wrap the result with Optional if the field default value is None
- Return type
-
classmethod