The `titlecase` library is a Python port of John Gruber's `titlecase.pl` script (version 2.4.1). It provides a more intelligent and stylistically correct title-casing function than Python's built-in `str.title()` method. It applies rules from the New York Times Manual of Style, handling 'small words' (like articles, conjunctions, and prepositions) and employing heuristics for abbreviations, aiming for publication-ready titles. The library maintains an active status with updates occurring as needed for bug fixes or minor enhancements.
pip install titlecaseVerified import paths — ran on the pinned version, not inferred.
Demonstrates basic title-casing and how to use a custom callback function to handle specific abbreviations or words that should not be automatically title-cased.
Always import and use the `titlecase` function from this library for grammatically correct title casing, especially for headlines and titles.
For highly specific formatting needs, consider using the `callback` argument to define custom rules for particular words or abbreviations, or pre-process text that falls outside American English conventions.
pip install titlecase
import titlecase
titlecase.titlecase("your string here")import titlecase
titlecase.titlecase("Your string here")from titlecase import titlecase
No dependency data recorded yet.