NameCase

class xsdata.models.config.NameCase(value)[source]

Code writer naming schemes.

All schemes are using a processor that splits a string into words when it encounters non alphanumerical characters or when an upper case letter follows a lower case letter.

Original

Pascal

Camel

Snake

Screaming Snake

Mixed

Mixed Snake

Mixed Pascal

p00p

P00P

p00P

p00p

P00P

p00p

p00p

P00p

USERName

Username

username

username

USERNAME

USERName

USERName

USERName

UserNAME

UserName

userName

user_name

USER_NAME

UserNAME

User_NAME

UserNAME

USER_name

UserName

userName

user_name

USER_NAME

USERname

USER_name

USERname

USER-NAME

UserName

userName

user_name

USER_NAME

USERNAME

USER_NAME

USERNAME

User_Name

UserName

userName

user_name

USER_NAME

UserName

User_Name

UserName

user_name

UserName

userName

user_name

USER_NAME

username

user_name

Username

SUserNAME

SuserName

suserName

suser_name

SUSER_NAME

SUserNAME

SUser_NAME

SUserNAME

Variables
  • ORIGINAL – originalCase

  • PASCAL – pascalCase

  • CAMEL – camelCase

  • SNAKE – snakeCase

  • SCREAMING_SNAKE – screamingSnakeCase

  • MIXED – mixedCase mixedCase

  • MIXED_SNAKE – mixedSnakeCase

  • MIXED_PASCAL – mixedPascalCase

__call__(string, **kwargs)[source]

Either returns an existing member, or creates a new enum class.

This method is used both when an enum class is given a value to match to an enumeration member (i.e. Color(3)) and for the functional API (i.e. Color = Enum(‘Color’, names=’RED GREEN BLUE’)).

When used for the functional API:

value will be the name of the new class.

names should be either a string of white-space/comma delimited names (values will start at start), or an iterator/mapping of name, value pairs.

module should be set to the module this class is being created in; if it is not set, an attempt to find that module will be made, but if it fails the class will not be picklable.

qualname should be set to the actual location this class can be found at in its module; by default it is set to the global scope. If this is not correct, unpickling will fail in some circumstances.

type, if set, will be mixed in as the first base class.

Return type

str

property callback: Callable

Return the actual callable of the scheme.

Return type

Callable