Skip to main content

RB 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:

Installing

$ poetry add rb_tocase

or

$ pip install rb_tocase

Examples:

Importing:

>>> from rb_tocase import Case
>>> # or
>>> from rb_tocase import *
>>> # see the examples below

Convert to Camel Case:

>>> Case.to_camel("Changing to CaMel CASE")   # From String Sentence
'changingToCamelCase'
>>> Case.to_camel("Changing-to-camel-case")   # From Kebab Case
'changingToCamelCase'
>>> Case.to_camel("Changing_to_CAMEL_CASE")   # From Snake Case
'changingToCamelCase'
>>> Case.to_camel(" ChangingToCamelCase  ")   # From Pascal Case
'changingToCamelCase'

Convert to Snake Case:

>>> Case.to_snake(" ChanginToSnakeCase ")     # From Pascal Case
'changin_to_snake_case'
>>> Case.to_snake(" Changin To Snake Case ")  # From String
'changin_to_snake_case'
>>> Case.to_snake(" Changin-To-Snake-Case ")  # From Kebab
'changin_to_snake_case'
>>> Case.to_snake(" changinToSnakeCase ")     # From Camel
'changin_to_snake_case'

See more

Convert to Kebab Case:

>>> Case.to_kebab("Changing to Kebab")    # From String
'changing-to-kebab'
>>> Case.to_kebab("ChangingToKebab")      # From Pascal Case
'changing-to-kebab'
>>> Case.to_kebab("changingToKebab")      # From Camel Case
'changing-to-kebab'
>>> Case.to_kebab("changing_to_kebab")    # From Snake Case
'changing-to-kebab'

See more

Convert to Pascal Case:

>>> Case.to_pascal("Changing to Pascal")  # From String
'ChangingToPascal'
>>> Case.to_pascal("Changing-to-Pascal")  # From Kebab
'ChangingToPascal'
>>> Case.to_pascal("Changing_to_Pascal")  # From Snake
'ChangingToPascal'
>>> Case.to_pascal("ChangingtoPascal")    # From Pascal
'ChangingtoPascal'
>>> Case.to_pascal("changingToPascal") # From Camel
'ChangingToPascal'

Convert to Sentence:

>>> Case.to_sentence("ItsAPascalCase")
'its a pascal case'
>>> Case.to_sentence("itsACamelCase")
'its a camel case'
>>> Case.to_sentence("Its-A-Kebab-Case")
'its a snake case'
>>> Case.to_sentence("Its_a_snake_case")
'its a snake case'

Read The Docs!

Documentation

Metadata

Release files for rb-tocase 1.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rb-tocase 1.3.2
File Size Uploaded
rb_tocase-1.3.2.tar.gz 5.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rb-tocase 1.3.2
File Interpreter ABI Platform
rb_tocase-1.3.2-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 10.2 kB

Release files / rb_tocase-1.3.2.tar.gz

Download URL rb_tocase-1.3.2.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b192e499376b7a8527de448a52fba6b4e3c5b033232efe9324ef189e786b92c1
BLAKE2b-256 checksum
How to use checksums
1cf4f4502d0e85163b0500b39fffddbb9b9966eca39cee1b26f5d403dfecb00e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.12 CPython/3.10.0 Windows/10

Release files / rb_tocase-1.3.2-py2.py3-none-any.whl

Download URL rb_tocase-1.3.2-py2.py3-none-any.whl
Size 4.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
58329b45f293d89f275e914492dd339579b6287b7d84efa6bc8b184980bb5f39
BLAKE2b-256 checksum
How to use checksums
f3f53d319422eee3630124caf022e8fadf39646f406f810b29bedb1fa978d65d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.12 CPython/3.10.0 Windows/10

Release history Release notifications | RSS feed

This release

1.3.2 This release

2 release files

1.3.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page