Learn to Code ยท zero-dependency ยท MIT

larzcase

Convert naming conventions.

Different contexts want different naming styles - Python snake_case, JavaScript camelCase, URLs kebab-case, constants CONSTANT_CASE. Converting between them, especially handling camelCase word boundaries correctly, is fiddly. larzcase does it once, cleanly, by splitting into words and re-joining.

larzscript pkg install case
View on GitHub →Learn the stack

What you get

Try it

import "case" as case_
print(case_.camel("hello world"))
print(case_.pascal("hello-world"))
print(case_.kebab("Hello World"))
print(case_.snake("Hello World"))
Output
helloWorld
HelloWorld
hello-world
hello_world

Why it's in the Larz Stack

larzcase is a real Larzscript package (larzscript pkg install case) - money-native, zero dependencies, the same language as the rest of the estate, not a separate Python runtime. It composes with the rest of the Larz Stack and the Larz framework.