Text Case Conversion¶
Case conversion utilities.
Case Conversion Module¶
Functions for converting text between different case formats.
Modules¶
case_to_acronym
¶
case_to_alphabet_position
¶
case_to_alternate_character_deletion
¶
case_to_diagonal_text
¶
case_to_first_letter_of_each_word
¶
case_to_leet_speak
¶
case_to_pig_latin
¶
case_to_random
¶
case_to_slug
¶
case_to_spinal
¶
case_to_spongebob_meme
¶
case_to_spongebob_mocking
¶
case_to_swap
¶
case_to_upper_consonant
¶
case_to_upper_vowel
¶
case_to_upside_down
¶
case_to_zalgo_text
¶
to_camel_case
¶
Camel Case Conversion¶
Convert text to camelCase format.
Functions¶
to_camel_case(text: str) -> str
¶
Convert text to camelCase.
Converts the input text to camel case where the first word is lowercase and subsequent words are capitalized.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
The text to convert. |
required |
Returns:
| Type | Description |
|---|---|
str
|
The text converted to camelCase. |
Example
to_camel_case("hello world") 'helloWorld' to_camel_case("Hello World") 'helloWorld'
to_constant_case
¶
Constant Case Conversion¶
Convert text to CONSTANT_CASE format.
Functions¶
to_constant_case(text: str) -> str
¶
Convert text to CONSTANT_CASE.
Converts the input text to constant case (screaming snake case) by replacing spaces and special characters with underscores and converting to uppercase.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
The text to convert. |
required |
Returns:
| Type | Description |
|---|---|
str
|
The text converted to CONSTANT_CASE. |
Example
to_constant_case("Hello World") 'HELLO_WORLD' to_constant_case("helloWorld") 'HELLO_WORLD'
to_dot_case
¶
Dot Case Conversion¶
Convert text to dot.case format.
Functions¶
to_dot_case(text: str) -> str
¶
Convert text to dot.case.
Converts the input text to dot case by replacing spaces and special characters with dots and converting to lowercase.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
The text to convert. |
required |
Returns:
| Type | Description |
|---|---|
str
|
The text converted to dot.case. |
Example
to_dot_case("Hello World") 'hello.world' to_dot_case("helloWorld") 'hello.world'
to_kebab_case
¶
Kebab Case Conversion¶
Convert text to kebab-case format.
Functions¶
to_kebab_case(text: str) -> str
¶
Convert text to kebab-case.
Converts the input text to kebab case by replacing spaces and special characters with hyphens and converting to lowercase.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
The text to convert. |
required |
Returns:
| Type | Description |
|---|---|
str
|
The text converted to kebab-case. |
Example
to_kebab_case("Hello World") 'hello-world' to_kebab_case("helloWorld") 'hello-world'
to_pascal_case
¶
Pascal Case Conversion¶
Convert text to PascalCase format.
Functions¶
to_pascal_case(text: str) -> str
¶
Convert text to PascalCase.
Converts the input text to Pascal case where all words are capitalized and joined without separators.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
The text to convert. |
required |
Returns:
| Type | Description |
|---|---|
str
|
The text converted to PascalCase. |
Example
to_pascal_case("hello world") 'HelloWorld' to_pascal_case("hello_world") 'HelloWorld'
to_path_case
¶
Path Case Conversion¶
Convert text to path/case format.
Functions¶
to_path_case(text: str) -> str
¶
Convert text to path/case.
Converts the input text to path case by replacing spaces and special characters with forward slashes and converting to lowercase.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
The text to convert. |
required |
Returns:
| Type | Description |
|---|---|
str
|
The text converted to path/case. |
Example
to_path_case("Hello World") 'hello/world' to_path_case("helloWorld") 'hello/world'
to_sentence_case
¶
Sentence Case Conversion¶
Convert text to Sentence case format.
Functions¶
to_sentence_case(text: str) -> str
¶
Convert text to Sentence case.
Converts the input text to sentence case where only the first letter of the first word is capitalized and the rest is lowercase.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
The text to convert. |
required |
Returns:
| Type | Description |
|---|---|
str
|
The text converted to Sentence case. |
Example
to_sentence_case("hello world") 'Hello world' to_sentence_case("HELLO WORLD") 'Hello world'
to_snake_case
¶
Snake Case Conversion¶
Convert text to snake_case format.
Functions¶
to_snake_case(text: str) -> str
¶
Convert text to snake_case.
Converts the input text to snake case by replacing spaces and special characters with underscores and converting to lowercase.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
The text to convert. |
required |
Returns:
| Type | Description |
|---|---|
str
|
The text converted to snake_case. |
Example
to_snake_case("Hello World") 'hello_world' to_snake_case("helloWorld") 'hello_world'
to_title_case
¶
Title Case Conversion¶
Convert text to Title Case format.
Functions¶
to_title_case(text: str) -> str
¶
Convert text to Title Case.
Converts the input text to title case where the first letter of each word is capitalized.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
The text to convert. |
required |
Returns:
| Type | Description |
|---|---|
str
|
The text converted to Title Case. |
Example
to_title_case("hello world") 'Hello World' to_title_case("HELLO WORLD") 'Hello World'
options: show_root_heading: true show_source: false heading_level: 2