PyPI: https://pypi.org/project/case-convert/
安装
pip install case-convert
代码示例
# -*- coding: utf-8 -*- from case_convert import ( camel_case, kebab_case, pascal_case, snake_case, upper_case ) text = 'hello_world' print(camel_case(text)) # helloWorld print(kebab_case(text)) # hello-world print(pascal_case(text)) # HelloWorld print(snake_case(text)) # hello_world print(upper_case(text)) # HELLO_WORLD