Python library for text case conversions.
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file textcase-0.4.4.tar.gz.
File metadata
- Download URL: textcase-0.4.4.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4af6f5e029f7c5a1d48bc49e3758351e15ff28e8f09c929ffb704f71b894ecab
|
|
| MD5 |
0cad498e8293232869f809806ad7f2c2
|
|
| BLAKE2b-256 |
1ffa61085c42bb62c83565453fb8b1aee823576aade439ba24faa83975519ee9
|
Provenance
The following attestation bundles were made for textcase-0.4.4.tar.gz:
Publisher:
publish.yaml on zobweyt/textcase
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
textcase-0.4.4.tar.gz -
Subject digest:
4af6f5e029f7c5a1d48bc49e3758351e15ff28e8f09c929ffb704f71b894ecab - Sigstore transparency entry: 576006242
- Sigstore integration time:
-
Permalink:
zobweyt/textcase@9e57e59c1e089315a3efc0ead1bb0416c2b74bbc -
Branch / Tag:
refs/heads/main - Owner: https://github.com/zobweyt
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@9e57e59c1e089315a3efc0ead1bb0416c2b74bbc -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file textcase-0.4.4-py3-none-any.whl.
File metadata
- Download URL: textcase-0.4.4-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a9fad2e148bba3fb9dc40cdbb97ea948e8d548b5d486c9405faba5bc92fdce22
|
|
| MD5 |
b99c9b3b81d759999ed85d02766b1a59
|
|
| BLAKE2b-256 |
5a21896ad43ee6a42a5e18fdf5b2761eb5a74d4e5554f74a33fda01e14301482
|
Provenance
The following attestation bundles were made for textcase-0.4.4-py3-none-any.whl:
Publisher:
publish.yaml on zobweyt/textcase
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
textcase-0.4.4-py3-none-any.whl -
Subject digest:
a9fad2e148bba3fb9dc40cdbb97ea948e8d548b5d486c9405faba5bc92fdce22 - Sigstore transparency entry: 576006309
- Sigstore integration time:
-
Permalink:
zobweyt/textcase@9e57e59c1e089315a3efc0ead1bb0416c2b74bbc -
Branch / Tag:
refs/heads/main - Owner: https://github.com/zobweyt
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@9e57e59c1e089315a3efc0ead1bb0416c2b74bbc -
Trigger Event:
workflow_dispatch
-
Statement type: