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

Uploaded Source

Built Distribution

case_switcher-1.2.1-py3-none-any.whl (14.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: case-switcher-1.2.1.tar.gz
  • Upload date:
  • Size: 14.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.9.7 Linux/5.15.15-76051515-generic

File hashes

Hashes for case-switcher-1.2.1.tar.gz
Algorithm Hash digest
SHA256 1c1e3da6cbdcae9e06c68510ed7ac2b7b72c231b12a71cd88f264c8a1def2465
MD5 169f9fae60e859589a6dddcce2c39899
BLAKE2b-256 a4eb66617c2e1dff0182f51a641e49bacfb8a96116acf43d287c4f12b92c4d36

See more details on using hashes here.

File details

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

File metadata

  • Download URL: case_switcher-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 14.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.9.7 Linux/5.15.15-76051515-generic

File hashes

Hashes for case_switcher-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a4491fed52f89f9cf6de1629dfe50c168fc8e838dc9370d07da447af61bc0f6b
MD5 095d5a66470c774a1c2c1a37fba74bba
BLAKE2b-256 47f1b289b868dd9d00eb74ff3a4b44082de7dfb8843b6fbe8cbee2fb9fe10755

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