Generator ConfigΒΆ

The configuration offers more advance options to further tail the output to your needs, like naming conventions and substitutions.

Warning

Since v21.12 the aliases were replaced by the substitutions config which is a more flexible search and replace process with support for regular expressions.

During initialization aliases will be migrated to substitutions and the config will be automatically updated, but you should also verify you still get the desired output.

<?xml version="1.0" encoding="UTF-8"?>
<Config xmlns="http://pypi.org/project/xsdata" version="22.2">
  <Output maxLineLength="79">
    <Package>generated</Package>
    <Format repr="true" eq="true" order="false" unsafeHash="false" frozen="false" slots="false" kwOnly="false">dataclasses</Format>
    <Structure>filenames</Structure>
    <DocstringStyle>reStructuredText</DocstringStyle>
    <RelativeImports>false</RelativeImports>
    <CompoundFields defaultName="choice" forceDefaultName="false">false</CompoundFields>
    <PostponedAnnotations>false</PostponedAnnotations>
  </Output>
  <Conventions>
    <ClassName case="pascalCase" safePrefix="type"/>
    <FieldName case="snakeCase" safePrefix="value"/>
    <ConstantName case="screamingSnakeCase" safePrefix="value"/>
    <ModuleName case="snakeCase" safePrefix="mod"/>
    <PackageName case="snakeCase" safePrefix="pkg"/>
  </Conventions>
  <Substitutions>
    <Substitution type="package" search="http://www.w3.org/2001/XMLSchema" replace="xs"/>
    <Substitution type="package" search="http://www.w3.org/XML/1998/namespace" replace="xml"/>
    <Substitution type="package" search="http://www.w3.org/2001/XMLSchema-instance" replace="xsi"/>
    <Substitution type="package" search="http://www.w3.org/1999/xlink" replace="xlink"/>
    <Substitution type="package" search="http://www.w3.org/1999/xhtml" replace="xhtml"/>
    <Substitution type="package" search="http://schemas.xmlsoap.org/wsdl/soap/" replace="soap"/>
    <Substitution type="package" search="http://schemas.xmlsoap.org/wsdl/soap12/" replace="soap12"/>
    <Substitution type="package" search="http://schemas.xmlsoap.org/soap/envelope/" replace="soapenv"/>
    <Substitution type="class" search="Class" replace="Type"/>
  </Substitutions>
</Config>

GeneratorConfig

Generator configuration binding model.

GeneratorOutput

Main generator output options.

OutputFormat

Output format options.

GeneratorConventions

Generator global naming conventions.

GeneratorSubstitutions

Generator search and replace substitutions for classes, fields, packages and modules names.

StructureStyle

Code writer output structure strategies.

DocstringStyle

Code writer docstring styles.

CompoundFields

Compound fields options.

ObjectType

Object type enumeration.

GeneratorSubstitution

Search and replace substitution for a specific target type based on re.sub()

NameConvention

Name convention model.

NameCase

Code writer naming schemes.