syntactic.camel_case

syntactic.camel_case(obj: str | list[str], strict: bool = True, smart: bool = True, prefix: bool = True) list[str]

Convert strings to lowerCamelCase.

Parameters:
  • obj (str or list of str) – String(s) to convert.

  • strict (bool) – Enforce strict name sanitization. When True, this does not allow the return of any capitalized acronyms; e.g. “RNA” becomes “Rna”.

  • smart (bool) – Handle complicated special cases, such as mixed case acronyms, plus/minus, and percentages.

  • prefix (bool) – Prepend an “x” character if the string begins with a syntactically invalid character, such as a number.

Returns:

Strings converted to lowerCamelCase.

Return type:

list of str

Examples

>>> camel_case(["human genomeVersion", "sampleID"])
['humanGenomeVersion', 'sampleId']
>>> camel_case(["sampleID"], strict=False)
['sampleID']