refs #0 The root commit.
This commit is contained in:
18
back/core/helper.py
Normal file
18
back/core/helper.py
Normal file
@@ -0,0 +1,18 @@
|
||||
def snake_to_camel(snake_string: str) -> str:
|
||||
"""
|
||||
Transform string from snake case to string in camel case.
|
||||
|
||||
Returns the string in tme camel case.
|
||||
|
||||
:param snake_string: The string in the snake case.
|
||||
"""
|
||||
|
||||
return "".join(part.capitalize() for part in snake_string.split("_"))
|
||||
|
||||
|
||||
def get_file_name(name: str) -> str:
|
||||
return name.split(".")[-1]
|
||||
|
||||
|
||||
def get_parent_directory_name(name: str) -> str:
|
||||
return name.split(".")[-2]
|
||||
Reference in New Issue
Block a user