Skip to main content

RB toCase is a Case converter.

Project description

toCase

Cover

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'

See more

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'

See more

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!

Documentation

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

rb_tocase-1.3.1.tar.gz (5.1 kB view hashes)

Uploaded Source

Built Distribution

rb_tocase-1.3.1-py2.py3-none-any.whl (4.9 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page