textcase
Python library for text case conversions.
Documentation: https://zobweyt.github.io/textcase
PyPI: https://pypi.org/project/textcase
Features
- Text case conversion: convert strings between various text cases (e.g., snake_case, kebab-case, camelCase, etc.).
- Extensible: extend the library with custom word boundaries and cases.
- Accurate: handles any word boundaries in strings including acronyms (as in
"HTTPRequest"). - Non-ASCII Support: handles non-ASCII characters seamlessly (no inferences on the input language itself is made).
- Tiny, Performant & Zero Dependencies: a regex-free, efficient library that stays lightweight with no external dependencies.
- 100% test coverage: every line of code is rigorously tested for reliability.
- 100% type annotated codebase: full type annotations for best developer experience.
Installation
Create and activate a virtual environment and then install textcase:
pip install textcase
Usage
Convert a string to a text case:
import textcase
textcase.snake("Hello, world!") # hello_world
textcase.constant("Hello, world!") # HELLO_WORLD
textcase.kebab("Hello, world!") # hello-world
textcase.middot("Hello, world!") # hello·world
textcase.camel("Hello, world!") # helloWorld
textcase.pascal("Hello, world!") # HelloWorld
textcase.lower("Hello, world!") # hello world
textcase.upper("Hello, world!") # HELLO WORLD
textcase.title("Hello, world!") # Hello World
textcase.sentence("Hello, world!") # Hello world
See documentation for more usage examples.
Release files for textcase 0.4.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| textcase-0.4.5.tar.gz | 7.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| textcase-0.4.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.5 kB
Release files / textcase-0.4.5.tar.gz
| Download URL | textcase-0.4.5.tar.gz |
|---|---|
| Size | 7.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
97fd08754b7dba9bfa5daf4ace474645f6b66409fb00f483c5de729e730f8e52
|
|
BLAKE2b-256 checksum How to use checksums |
c008991940591c7a8de25505a4e43642d1c2b54f43c3ed76f8c90f1df6ee9525
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 10, 2025.
Transparency logRelease files / textcase-0.4.5-py3-none-any.whl
| Download URL | textcase-0.4.5-py3-none-any.whl |
|---|---|
| Size | 6.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bd5d6aaf653b339e3ac60ad96cfc960a94219a97da464eddeed7084f41774937
|
|
BLAKE2b-256 checksum How to use checksums |
5b486ea42c749608cfca883d5d8fae03edbcde636090d2bc751fd5da9157b451
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 10, 2025.
Transparency log