Skip to content

Convert

The most useful feature of Nomage is converting an identifier to another naming convention.

Python

You can convert to another naming convention with:

>>> from nomage import naming
>>> id_naming = naming("my-identifier")
>>> id_naming.to("pascal")
"MyIdentifier"

Unknown naming conventions will simply return source convention

>>> from nomage import naming
>>> id_naming = naming("my-identifier")
>>> id_naming.to("unknown")
nomage.exceptions.UnknownNamingConventionError: could not find naming convention 'unknown'

CLI

Convert from a terminal:

nomage my-identifier --to pascalMyIdentifier

nomage my-identifier --to pascal

Unknown naming convention will fail with a return code not equal to 0.

nomage my-identifier --to testCould not find naming convention 'test'

nomage my-identifier --to test