Library to change the casing of strings.
Project description
This library provides functions to change the casing convention of a string.
Supported cases:
- camelCase
- dot.case
- kebab-case
- PascalCase
- snake_case
- Title Case
- UPPER.DOT.CASE
- UPPER-KEBAB-CASE
- UPPER_SNAKE_CASE
Install
poetry add case-switcher
pip install case-switcher
Demo
import caseswitcher
sample = "avocado bagel-coffeeDONUTEclair_food.gravy"
caseswitcher.to_camel(sample) # -> "avocadoBagelCoffeeDONUTEclairFoodGravy"
caseswitcher.to_dot(sample) # -> "avocado.bagel.coffee.donut.eclair.food.gravy"
caseswitcher.to_kebab(sample) # -> "avocado-bagel-coffee-donut-eclair-food-gravy"
caseswitcher.to_pascal(sample) # -> "AvocadoBagelCoffeeDONUTEclairFoodGravy"
caseswitcher.to_snake(sample) # -> "avocado_bagel_coffee_donut_eclair_food_gravy"
caseswitcher.to_title(sample) # -> "Avocado Bagel Coffee DONUT Eclair Food Gravy"
caseswitcher.to_upper_dot(sample) # -> "AVOCADO.BAGEL.COFFEE.DONUT.ECLAIR.FOOD.GRAVY"
caseswitcher.to_upper_kebab(sample) # -> "AVOCADO-BAGEL-COFFEE-DONUT-ECLAIR-FOOD-GRAVY"
caseswitcher.to_upper_snake(sample) # -> "AVOCADO_BAGEL_COFFEE_DONUT_ECLAIR_FOOD_GRAVY"
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
case-switcher-1.2.13.tar.gz
(3.7 kB
view hashes)
Built Distribution
Close
Hashes for case_switcher-1.2.13-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce77348956be9b3730e5c35d255378c0a2218bd1061620fdbce8d4bda31953a1 |
|
MD5 | 59462b496c2fd6de88d667001a64719c |
|
BLAKE2b-256 | 2cb501a73b8b0928bbb13c29915725c931464faba588805e9356756bcb3b4c81 |