String Case Converter

1.2.0 · active · verified Thu Apr 09

Stringcase is a lightweight Python library providing functions to convert strings between various common casing conventions, such as camelCase, snake_case, PascalCase, kebab-case, and more. It is a stable, single-purpose utility with no external dependencies, currently at version 1.2.0, and typically sees infrequent updates unless new casing styles or critical bug fixes are required.

Warnings

Install

Imports

Quickstart

Demonstrates basic usage of `stringcase` to convert between camelCase, snake_case, kebab-case, and PascalCase using the module-level functions.

import stringcase

# Convert to camelCase
camel = stringcase.camelcase('hello_world')
print(f"camelcase: {camel}") # Expected: helloWorld

# Convert to snake_case
snake = stringcase.snakecase('HelloWorld')
print(f"snakecase: {snake}") # Expected: hello_world

# Convert to kebab-case
kebab = stringcase.kebabcase('helloWorld')
print(f"kebabcase: {kebab}") # Expected: hello-world

# Convert to PascalCase
pascal = stringcase.pascalcase('hello-world')
print(f"pascalcase: {pascal}") # Expected: HelloWorld

view raw JSON →