textcase
Python library for text case conversions.
What it is and what it does
textcase is a pure-Python library for converting strings between different text case formats—snake_case, kebab-case, camelCase, PascalCase, CONSTANT_CASE, and others. It handles word boundary detection automatically, including acronyms (e.g., "HTTPRequest"), non-ASCII characters, and punctuation, without requiring regex or external dependencies. The library is fully type-annotated and carries 100% test coverage.
You import it and call functions like `textcase.snake()`, `textcase.camel()`, or `textcase.pascal()` on any string. It's useful when you need to normalize identifiers across different naming conventions—for instance, converting API response field names to Python variable names, or generating code identifiers from user input. With zero dependencies and a small footprint, it's safe to add to any project.
Use it for:
- Convert API response field names (often snake_case) to camelCase for JavaScript or PascalCase for C#
- Generate valid Python variable or function names from user-provided strings or external data
- Normalize configuration keys or environment variable names across different naming conventions
- Transform database column names to match code style conventions in ORM or data mapping layers
- Build code generators or template systems that need to adapt identifiers to target language conventions
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Converts strings between different text case formats (snake_case, kebab-case, camelCase, PascalCase, etc.) with support for non-ASCII characters and custom word boundaries.
Yes. textcase is lightweight (zero dependencies), actively maintained, well-tested, and solves a common string-manipulation task cleanly. Install it if you need reliable case conversion; the low friction and permissive license make it a safe addition to any project.
Install
textcase on PyPI
pip
pip install textcaseuv
uv add textcasepoetry
poetry add textcaseInstalling textcase
Before you install
Low friction: pure Python wheel with zero runtime dependencies and active maintenance. Last commit 2026-08-08, 236 repository stars, and 125731 monthly downloads indicate steady adoption.
License in practice
MIT license (permissive) means you can use, modify, and distribute this package freely in both open-source and commercial projects with minimal restrictions.
Quickstart
pip install textcase
import textcase
textcase.snake("Hello, world!") # hello_world
textcase.camel("Hello, world!") # helloWorld
textcase.pascal("Hello, world!") # HelloWorld
Verify before relying
- Whether the library's handling of acronyms and non-ASCII boundaries covers all real-world edge cases beyond the documented examples
- Performance characteristics when processing very large strings or high-volume batch conversions
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 308 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 125,731/month — #11,803 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: textcase-0.4.5-py3-none-any.whl
Keywords: camel-case, case, constant-case, conversion, kebab-case, lower-case, middot-case, pascal-case, sentence-case, snake-case, text, title-case, upper-case
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
case-conversionConverts strings between any case format…
permissive · top 15,000 on PyPI
case-converterConverts strings between different naming…
permissive · top 15,000 on PyPI
jinja2-strcaseAdds string-case conversion filters to Jinja2…
permissive · top 15,000 on PyPI
casefyCasefy converts strings between different…
permissive · top 5,000 on PyPI
stringcaseConverts strings between different naming…
permissive · top 5,000 on PyPI
humpsConverts strings to camelCase format, handling…
copyleft · top 15,000 on PyPI
pyheckConverts strings between case styles…
permissive · top 15,000 on PyPI
case-convertConverts strings between different case formats…
copyleft · top 15,000 on PyPI
boa-strConverts strings to snake_case by normalizing…
permissive · top 5,000 on PyPI
StrEnumStrEnum is a string-based enum class that…
permissive · top 1,000 on PyPI