Detection and conversion between letter cases
Project description
Lettercase
A Python library for detecting and converting between various letter cases.
Supported cases:
- snake_case
- SCREAMING_SNAKE_CASE
- Darwin_Case
- dromedaryCase
- PascalCase
Installation
Using pip
pip install lettercase
Usage
The basic usage of the library is pretty straight-forward.
To simply convert a string to another case:
>>> import lettercase
>>> lettercase.convert_to("helloWorld", "snake")
hello_world
To detect the case, use the detect_case
function
which returns a set of all possible cases for the given
string.
>>> import lettercase
>>> lettercase.detect_case("helloWorld")
{LetterCase.DROMEDARY}
By default the function only checks as much of the string
as is necessary to get a unique match, however, if you need
to make sure that the letter case is correct for the entire string,
you can pass fast_return=False
.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
lettercase-0.2.2.tar.gz
(6.2 kB
view hashes)
Built Distribution
Close
Hashes for lettercase-0.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d3b3c6f3297db734a0d15b53dec8dd98f067e02224a18a88c1d8feb97d479080 |
|
MD5 | 37d24f9b7d0750b8152a449c4745e35f |
|
BLAKE2b-256 | 72570587eec5f7664d1cc6cbc48e44356a4f84ab3473402530a9295d812cc002 |