Skip to main content

Case converter

Project description

Super-case-convertor-2000

Quick start


First, install the library

pip3 install super-case-converter-2000

include in your project

from converter import case

Methods

snake

Convert string to 'snake case' string

alias

  • c_case
snake(string: str = "", replaceSeparator: Optional[str] = None) -> str:

Example

string_camel = "stringCase"

string_snake = case.snake(string=string_camel)

# alias
string_c_case = case.c_case(string=string_camel)

print(string_snake, string_c_case)
Output
string_case string_case

Example

string_custom = "string!!case"

string_snake = case.snake(string=string_custom, replaceSeparator='!!')

# alias
string_c_case = case.c_case(string=string_custom, replaceSeparator='!!')

print(string_snake, string_c_case)
Output
string_case string_case

camel

Convert string to 'camel case' string

camel(string: str = "", replaceSeparator: Optional[str] = None) -> str:

Example

string_snake = "string_case"

string_camel = case.camel(string=string_snake)

print(string_camel)
Output
stringCase

Example

string_custom = "string!!case"

string_camel = case.camel(string=string_custom, replaceSeparator='!!')

print(string_camel)
Output
stringCase

pascal

Convert string to 'pascal case' string

alias

  • capital_camel
pascal(string: str = "", replaceSeparator: Optional[str] = None) -> str:

Example

string_snake = "string_case"

string_pascal = case.pascal(string=string_snake)

# alias
string_capital_camel = case.capital_camel(string=string_snake)

print(string_pascal, string_capital_camel)
Output
StringCase StringCase

Example

string_custom = "string!!case"

string_pascal = case.pascal(string=string_custom, replaceSeparator='!!')

print(string_pascal)
Output
StringCase

kebab

Convert string to 'kebak case' string

alias

  • kebabm
  • caterpillar
  • dash
  • hyphen
  • lisp
  • spinal
  • css
kebab(string: str = "", replaceSeparator: Optional[str] = None) -> str:

Example

string_snake = "string_case"

string_kebab = case.kebab(string=string_snake)

# alias
string_caterpillar = case.caterpillar(string=string_snake)

print(string_kebab, string_caterpillar)

Output

string-case string-case

Example

string_custom = "string!!case"

string_kebab = case.kebab(string=string_custom, replaceSeparator='!!')

print(string_kebab)

Output

string-case

flat

Convert string to 'flat case' string

flat(string: str = "", replaceSeparator: Optional[str] = None) -> str:

Example

string_snake = "string_case"

string_flat = case.flat(string=string_snake)

print(string_flat)

Output

stringcase

Example

string_custom = "string!!case"

string_flat = case.flat(string=string_custom, replaceSeparator='!!')

print(string_flat)

Output

stringcase

raw

Convert string to 'raw case' string

raw(string: str = "", replaceSeparator: Optional[str] = None) -> str:

Example

string_snake = "string_case"

string_raw = case.raw(string=string_snake)

print(string_raw)

Output

string case

Example

string_custom = "string!!case"

string_raw = case.raw(string=string_custom, replaceSeparator='!!')

print(string_raw)

Output

string case

path

Convert string to 'path' string

path(string: str = "", replaceSeparator: Optional[str] = None) -> str:

Example

string_snake = "string_case"

string_path = case.path(string=string_snake)

print(string_path)

Output

string/case

Example

string_custom = "string!!case"

string_path = case.path(string=string_custom, replaceSeparator='!!')

print(string_path)

Output

string/case

piped

Convert string to 'piped' string

piped(string: str = "", replaceSeparator: Optional[str] = None) -> str:

Example

string_snake = "string_case"

string_piped = case.piped(string=string_snake)

print(string_piped)

Output

string|case

Example

string_custom = "string!!case"

string_piped = case.piped(string=string_custom, replaceSeparator='!!')

print(string_piped)

Output

string|case

title

Convert string to 'title case' string

title(string: str = "", replaceSeparator: Optional[str] = None) -> str:

Example

string_snake = "string_case"

string_title = case.title(string=string_snake)

print(string_title)

Output

String Case

Example

string_custom = "string!!case"

string_title = case.title(string=string_custom, replaceSeparator='!!')

print(string_title)

Output

String Case

custom

Convert string to 'custom separator' string

custom(string: str = "", separator: str = "",replaceSeparator: Optional[str] = None) -> str:

Example

string_snake = "string_case"

string_custom = case.custom(string=string_snake, separator='<#>')

print(string_custom)

Output

string<#>case

Example

string_custom = "string!!case"

string_custom = case.custom(string=string_custom, separator='<#>', replaceSeparator='!!')

print(string_custom)

Output

string<#>case

custom_between

Convert string to 'custom between' list of strings

custom_between(string: str = "", open: str = "", close: Optional[str] = None, replaceSeparator: Optional[str] = None) -> list:

Example

string_snake = "string_case"

list_custom_between = case.custom_between(
  string=string_snake,
  open='<',
  close='>'
)

print(list_custom_between)

Output

['<string>', '<case>']

Example

string_custom = "string!!case"

list_custom_between = case.custom_between(
  string=string_custom,
  open='<',
  close='>',
  replaceSeparator='!!'
)

print(list_custom_between)

Output

['<string>', '<case>']

sentence

Convert string to 'sentence case' string or list of strings

sentence(string: str = "", listMode: bool = False, capitalize: bool = False, upper: bool = False, replaceSeparator: Optional[str] = None) -> Union[str, list]:

Example

string_snake = "string_case"

string_sentence = case.sentence(string=string_snake)

print(string_sentence)

Output

String case

Example

string_snake = "string_case"

string_sentence_capitalize = case.sentence(string=string_snake, capitalize=True)

print(string_sentence_capitalize)

Output

String Case

Example

string_snake = "string_case"

string_sentence_upper = case.sentence(string=string_snake, upper=True)

print(string_sentence_upper)

Output

STRING CASE

Example

string_snake = "string_case"

list_sentence = case.sentence(string=string_snake, listMode=True)

print(list_sentence)

Output

['String', 'case']

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

super-case-converter-2000-1.1.2.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

super_case_converter_2000-1.1.2-py3-none-any.whl (42.3 kB view details)

Uploaded Python 3

File details

Details for the file super-case-converter-2000-1.1.2.tar.gz.

File metadata

  • Download URL: super-case-converter-2000-1.1.2.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.3

File hashes

Hashes for super-case-converter-2000-1.1.2.tar.gz
Algorithm Hash digest
SHA256 3e429c85b02963507477b2edd548bb972e6d93ecdfc60ef6158fbb09a489c6c1
MD5 7d923b4c435eccd12ff248bb5d522fad
BLAKE2b-256 04e023b6c764c0afd13b247b349be4d2ef49002d26cc709231dcf9786c8bc335

See more details on using hashes here.

File details

Details for the file super_case_converter_2000-1.1.2-py3-none-any.whl.

File metadata

  • Download URL: super_case_converter_2000-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 42.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.3

File hashes

Hashes for super_case_converter_2000-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ee9d4a4dcfa168030259acf97dca7c2b4b7f46b02229ebe89d8f15bfd17d7581
MD5 92440bb84554c96bdabf78b18701f510
BLAKE2b-256 086b2196800d4020acabdd2279a0604e6d61bb265e86b453a6d836c17f49a0af

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page