syntactic.kebab_case

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

Convert strings to kebab-case.

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

  • 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 kebab-case.

Return type:

list of str

Examples

>>> kebab_case(["human genomeVersion", "sampleID"])
['human-genome-version', 'sample-id']