xsdata.codegen.writer module

class xsdata.codegen.writer.CodeWriter(generators=<factory>)[source]

Bases: object

Proxy to format generators and files structure creation.

Parameters

generators (Dict[str, AbstractGenerator]) –

generators: Dict[str, AbstractGenerator]
property formats

Return a list of the registered generator names.

Return type

List[str]

register_format(name, generator)[source]

Register a new generator by name.

Parameters
get_format(name)[source]

Get a generator by name.

Parameters

name (str) –

Return type

AbstractGenerator

write(classes, output)[source]

Iterate over the designated generator outputs and create the necessary directories and files.

Parameters
print(classes, output)[source]

Iterate over the designated generator outputs and print them to the console.

Parameters
designate(classes, output)[source]

Normalize the target package and module names by the given output generator.

Parameters
module_name(module, output)[source]

Proxy method for the format generator.

Parameters
  • module (str) –

  • output (str) –

Return type

str

package_name(package, output)[source]

Proxy method for the format generator.

Parameters
  • package (str) –

  • output (str) –

Return type

str