tessl install tessl/pypi-titlecase@2.4.0Python port of John Gruber's titlecase.pl for intelligent title case conversion with style guide compliance
Agent Success
Agent success rate when using this tile
79%
Improvement
Agent success rate improvement when using this tile compared to baseline
0.92x
Baseline
Agent success rate without this tile
86%
A utility that converts text strings into proper title case format following journalistic style guidelines.
@generates
Converts strings to title case where most words are capitalized, but certain small words remain lowercase when they appear in the middle of the title.
Ensures the first and last words of a title are always capitalized, even if they are typically considered small words.
Capitalizes words that follow subphrase punctuation like colons, question marks, and exclamation marks.
def format_title(text: str) -> str:
"""
Converts a text string to title case following journalistic style guidelines.
Small words (a, an, and, as, at, but, by, en, for, if, in, of, on, or,
the, to, v, v., via, vs, vs.) are kept lowercase when they appear in the
middle of the title. The first and last words are always capitalized.
Words following colons, question marks, exclamation marks, and similar
punctuation are capitalized.
Args:
text: The input string to convert to title case
Returns:
The text converted to proper title case format
Examples:
format_title("this is a test")
# Returns: "This Is a Test"
format_title("question: what happens?")
# Returns: "Question: What Happens?"
"""
passProvides title case conversion functionality following style guide rules.
@satisfied-by