Overview
TheCaseConverter class provides static methods for transforming text case in metadata fields. It supports common case conversions including title case, sentence case, uppercase, and lowercase.
Import
Methods
to_title_case
Converts text to title case (capitalizes the first letter of each word).The text to convert
to_sentence_case
Converts text to sentence case (capitalizes only the first letter).The text to convert
to_upper_case
Converts all characters to uppercase.The text to convert
to_lower_case
Converts all characters to lowercase.The text to convert
Usage Example
Applying case conversion to metadata:Notes
- All methods are static and do not require instantiation
- Methods safely handle empty or
Noneinput by returning an empty string - The
to_title_caseimplementation uses Python’s built-instr.title()method - Case conversion does not modify the original text; it returns a new string
