Created
November 27, 2022 05:42
-
-
Save Rigil-Kent/e91b9afbd5ad6048aa7205bbda9af7ad to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def camel_to_snake(data: str) -> str: | |
data = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', data) | |
return re.sub('([a-z0-9])([A-Z])', r'\1_\2', data).lower() | |
def snake_to_pascal(data: str) -> str: | |
return ''.join[word.title() for word in data.split('_')] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment