""" 自定义的一些 json功能 """ import re def underscore_to_camelcase(snake_str): """ 将下划线命名转换为驼峰命名 """ components = snake_str.split('_') return components[0] + ''.join(x.title() for x in components[1:]) def camelcase_to_underscore(camel_str): """将驼峰命名转换为下划线命名""" return re.sub(r'(?