Detection and conversion between letter cases
Project description
Lettercase
A Python library for detecting and converting between various letter cases.
Supported cases:
- snake_case
- UPPER_SNAKE_CASE
- Darwin_Case
- dromedaryCase
- PascalCase
Installation
Using pipenv
pipenv install lettercase
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.0.tar.gz
(4.4 kB
view hashes)
Built Distribution
Close
Hashes for lettercase-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f610df2d4f3234515c04133f10cdb761c59399674c1b4e379fa641b55e4e3b0 |
|
MD5 | e980cbf2c0c968bddd6e28e5a55a2e54 |
|
BLAKE2b-256 | 94da6c633056de56038c691094d5a4ac809600b7195ff2096cb4291abd1515c9 |