https://github.com/gieseladev/lettercase
Detection and conversion between letter cases
https://github.com/gieseladev/lettercase
case lettercase python-library
Last synced: 5 months ago
JSON representation
Detection and conversion between letter cases
- Host: GitHub
- URL: https://github.com/gieseladev/lettercase
- Owner: gieseladev
- License: mit
- Created: 2019-03-06T14:19:40.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-04-20T18:12:05.000Z (about 5 years ago)
- Last Synced: 2025-08-25T04:43:55.502Z (10 months ago)
- Topics: case, lettercase, python-library
- Language: Python
- Size: 41 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Lettercase
[](https://circleci.com/gh/gieseladev/lettercase)
[](https://pypi.org/project/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
```shell
pip install lettercase
```
## Usage
The basic usage of the library is pretty straight-forward.
To simply convert a string to another case:
```pydocstring
>>> 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.
```pydocstring
>>> 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`.