RB toCase is a Case converter.
Project description
toCase
made by: RickBarreto
What is it?
RB toCase is a Case converter made in python, for peoples who wants simplify this feature. It can convert to and from Camel, Pascal, Snake, Kebab and Strings Sentences. And, You don't need say what is the input type, the code parse it. Just say whats is the output type.
Older name was toCase, but when I was publishing on Pipy tocase package already exists. So I changed the name!
Install
pip install git+https://github.com/RickBarretto/toCase.git
Why I must to use it?
- toCase was made to make easy your life with case converting
- I was made in python, so, if you want, you can copy the toCase.py and use in your project. It's free to use, look the MIT LICENSE.
Glossary:
Examples:
Importing:
>>> from toCase import Case
>>> # or
>>> from toCase import *
>>> # see the examples below
Convert to Camel Case:
>>> Case.toCamel("Changing to CaMel CASE") # From String Sentence
'changingToCamelCase'
>>> Case.toCamel("Changing-to-camel-case") # From Kebab Case
'changingToCamelCase'
>>> Case.toCamel("Changing_to_CAMEL_CASE") # From Snake Case
'changingToCamelCase'
>>> Case.toCamel(" ChangingToCamelCase ") # From Pascal Case
'changingToCamelCase'
Convert to Snake Case:
>>> Case.toSnake(" ChanginToSnakeCase ") # From Pascal Case
'changin_to_snake_case'
>>> Case.toSnake(" Changin To Snake Case ") # From String
'changin_to_snake_case'
>>> Case.toSnake(" Changin-To-Snake-Case ") # From Kebab
'changin_to_snake_case'
>>> Case.toSnake(" changinToSnakeCase ") # From Camel
'changin_to_snake_case'
Convert to Kebab Case:
>>> Case.toKebab("Changing to Kebab") # From String
'changing-to-kebab'
>>> Case.toKebab("ChangingToKebab") # From Pascal Case
'changing-to-kebab'
>>> Case.toKebab("changingToKebab") # From Camel Case
'changing-to-kebab'
>>> Case.toKebab("changing_to_kebab") # From Snake Case
'changing-to-kebab'
Convert to Pascal Case:
>>> Case.toPascal("Changing to Pascal") # From String
'ChangingToPascal'
>>> Case.toPascal("Changing-to-Pascal") # From Kebab
'ChangingToPascal'
>>> Case.toPascal("Changing_to_Pascal") # From Snake
'ChangingToPascal'
>>> Case.toPascal("ChangingtoPascal") # From Pascal
'ChangingtoPascal'
>>> Case.toPascal("changingToPascal") # From Camel
'ChangingToPascal'
Convert to Sentence:
>>> Case.toSentence("ItsAPascalCase")
'its a pascal case'
>>> Case.toSentence("itsACamelCase")
'its a camel case'
>>> Case.toSentence("Its-A-Kebab-Case")
'its a snake case'
>>> Case.toSentence("Its_a_snake_case")
'its a snake case'
Read The Docs!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
rb_tocase-1.3.1.tar.gz
(5.1 kB
view hashes)
Built Distribution
Close
Hashes for rb_tocase-1.3.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 205f2c85293566fca44d031b52224847c801a89379e262a5dc942f35e4dcd2df |
|
MD5 | dc66cf3aa8d5275a279bca7f9bd03cb2 |
|
BLAKE2b-256 | 3a806a1ddc1a811a6219505c77f7356c60b8927740739ad06c70325d11fb4a48 |