extended_data.primitives.transformations.strings.inflection

Convenience wrappers around :mod:inflection string helpers.

Module Contents

Functions

pluralize

Return the plural form of word, honoring an optional count.

singularize

Return the singular form of word.

camelize

Convert phrase to camel or Pascal case.

underscore

Convert phrase to snake case.

humanize

Make an identifier human-readable.

titleize

Convert phrase to title case.

ordinalize

Return the ordinal representation of value (e.g., 1st).

parameterize

Slugify phrase using the provided separator.

API

extended_data.primitives.transformations.strings.inflection.pluralize(word: str, count: int | None = None) str

Return the plural form of word, honoring an optional count.

extended_data.primitives.transformations.strings.inflection.singularize(word: str) str

Return the singular form of word.

extended_data.primitives.transformations.strings.inflection.camelize(phrase: str, uppercase_first_letter: bool = True) str

Convert phrase to camel or Pascal case.

extended_data.primitives.transformations.strings.inflection.underscore(phrase: str) str

Convert phrase to snake case.

extended_data.primitives.transformations.strings.inflection.humanize(phrase: str, capitalize: bool = True) str

Make an identifier human-readable.

extended_data.primitives.transformations.strings.inflection.titleize(phrase: str) str

Convert phrase to title case.

extended_data.primitives.transformations.strings.inflection.ordinalize(value: int | str) str

Return the ordinal representation of value (e.g., 1st).

extended_data.primitives.transformations.strings.inflection.parameterize(phrase: str, separator: str = '-') str

Slugify phrase using the provided separator.