textcase is a lightweight, performant Python library designed for comprehensive text case conversions. It supports a wide array of cases like snake_case, kebab-case, and camelCase, and handles complex word boundaries including acronyms and non-ASCII characters. The library is notable for having zero external dependencies and a strong focus on accuracy and extensibility. It is actively maintained with frequent releases, with the current version 0.4.5, released in October 2025, ensuring Python 3.14 compatibility.
pip install textcaseVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to import the `textcase` library and use its direct methods to convert strings between common text cases like snake_case, camelCase, kebab-case, and PascalCase. It also shows how to use the `.match()` method to check if a string conforms to a specific case.
Update your imports from `from textcase import case, convert` to `import textcase` and adjust calls from `convert(string, case.SNAKE)` to `textcase.snake(string)`.
If Unicode normalization is required for your text, preprocess strings using Python's `unicodedata` module (e.g., `unicodedata.normalize('NFKC', my_string)`) before passing them to `textcase` functions.Review the release notes for versions 0.4.2 and 0.4.4 for details on punctuation stripping changes. Ensure your tests cover expected punctuation behavior, especially for edge cases.
Run `pip install textcase` to install the library.
Update your code to use the new API. For example, replace `convert(my_string, case.SNAKE)` with `textcase.snake(my_string)`.
Ensure you are using `import textcase` and calling methods directly on the module, e.g., `textcase.snake("my string")`. The `case` object is no longer directly exposed in the same way for conversion functions.No dependency data recorded yet.