Skip to main content

Library to change the casing of strings.

Project description

Case Switcher

Change the casing of a string.

License: MIT Code style: black PyPI version Code Coverage CodeFactor

This library provides functions to change the casing convention of a string.

Supported cases:

  • camelCase
  • dot.case
  • kebab-case
  • PascalCase
  • path/case
  • 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_path(sample)  # -> "avocado/bagel/coffee/donut/eclair/food/gravy"
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


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.3.4.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

case_switcher-1.3.4-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file case-switcher-1.3.4.tar.gz.

File metadata

  • Download URL: case-switcher-1.3.4.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.10.4 Linux/5.18.10-76051810-generic

File hashes

Hashes for case-switcher-1.3.4.tar.gz
Algorithm Hash digest
SHA256 c312b1f960169bbf1034255550f2ab8ed5e951a313d02e16adc7e1612dc819ce
MD5 ee37bf41cfa08ba4673769797676d343
BLAKE2b-256 74110a3126ed64df66f0911775279520097e4c5cddfc4c337592dc91e06ba1d4

See more details on using hashes here.

File details

Details for the file case_switcher-1.3.4-py3-none-any.whl.

File metadata

  • Download URL: case_switcher-1.3.4-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.10.4 Linux/5.18.10-76051810-generic

File hashes

Hashes for case_switcher-1.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 32e11451d87a359367ea0cc4ab5893984ccb1589c51ba17dfb6afece9def7c81
MD5 58af9377b666e4a18d21f1b7cdc01432
BLAKE2b-256 518103ed4a5c649e48c84d594ca95677ca357700e98b38eb6982a1b2f1104c70

See more details on using hashes here.

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