skillfed

textcase

Python library for text case conversions.

textcase v0.4.5 125.7K downloads/30d#11,803 on PyPI236
Permissive license MIT Active released

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 textcase

uv

uv add textcase

poetry

poetry add textcase

Installing 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

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishNatural Language :: RussianOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Topic :: Software DevelopmentTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python ModulesTopic :: Text ProcessingTopic :: Text Processing :: LinguisticTyping :: Typed

Tags

text case conversionsnake case kebab case camel casestring case formatterconvert between text casescase conversion librarytext formatting utilitiescase transformation
string-formattingcase-conversiontext-processing

More Software Development packages