xsdata.formats.dataclass.filters module

xsdata.formats.dataclass.filters.class_name(name)[source]

Apply python conventions for class names.

Parameters

name (str) –

Return type

str

xsdata.formats.dataclass.filters.attribute_name(name)[source]

Apply python conventions for instance variable names.

Parameters

name (str) –

Return type

str

xsdata.formats.dataclass.filters.constant_name(name)[source]

Apply python conventions for constant names.

Parameters

name (str) –

Return type

str

xsdata.formats.dataclass.filters.type_name(attr_type)[source]

Return native python type name or apply class name conventions.

Parameters

attr_type (AttrType) –

Return type

str

xsdata.formats.dataclass.filters.attribute_metadata(attr, parent_namespace)[source]

Return a metadata dictionary for the given attribute.

Parameters
Return type

Dict

xsdata.formats.dataclass.filters.format_arguments(data)[source]

Format given dictionary as keyword arguments.

Parameters

data (Dict) –

Return type

str

xsdata.formats.dataclass.filters.class_docstring(obj, enum=False)[source]

Generate docstring for the given class and the constructor arguments.

Parameters
Return type

str

xsdata.formats.dataclass.filters.default_imports(output)[source]

Generate the default imports for the given package output.

Parameters

output (str) –

Return type

str

xsdata.formats.dataclass.filters.attribute_default(attr, ns_map=None)[source]

Generate the field default value/factory for the given attribute.

Parameters
Return type

Any

xsdata.formats.dataclass.filters.attribute_type(attr, parents)[source]

Generate type hints for the given attribute.

Parameters
Return type

str