Skip to main content

Library to change the casing of strings.

Project description

Case Switcher

License: AGPL v3 Code style: black PyPI version Code Coverage

Change casing of a string.

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

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


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

Uploaded Source

File details

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

File metadata

  • Download URL: case-switcher-1.1.12.tar.gz
  • Upload date:
  • Size: 14.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.5

File hashes

Hashes for case-switcher-1.1.12.tar.gz
Algorithm Hash digest
SHA256 06beeb40567faa7725f1703d199d8c27cbb9e9e4bf9c9326cffde5671be4ffb0
MD5 5715e1658242e5a8c4cf2715720ae7a7
BLAKE2b-256 407cd67146348547909dcb7bca304dcc939ed676b33bd4df90f315ec7951e6f9

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