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.1.0.tar.gz
(4.0 kB
view hashes)
Built Distribution
Close
Hashes for lettercase-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac66ed4e4ef72e4349093ca8c5f17516ef55b18367ce00414bcf571157caad6b |
|
MD5 | def3e31c3e0055c36e10e947d4b6e339 |
|
BLAKE2b-256 | f84b93145555b0094f2d5ee6afc8462c838b41e3ce5cc7484a7fdca8f4edb8cc |