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.3.1.tar.gz
(7.6 kB
view hashes)
Built Distribution
lettercase-0.3.1-py3-none-any.whl
(11.2 kB
view hashes)
Close
Hashes for lettercase-0.3.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0ce9a704d806bd839400713eb18914a05a9c91586d88e0b01e78b56a1016dd7 |
|
MD5 | 0f1cebb9dcfd143c90b4680fa9db3085 |
|
BLAKE2b-256 | 06830ce171f1dc9b851dd75fe1577c3f06006c50d7051149c26dcd5ee542fa18 |