def camelcase_to_snakecase(string_to_convert):
 s1 = re.sub('(.)([A-Z][a-z]+)', '\\1_\\2', string_to_convert)
 return re.sub('([a-z0-9])([A-Z])', '\\1_\\2', s1).lower()

def camelcase_to_snakecase ( string_to_convert ) : s1 = re . sub ( '(.)([A-Z][a-z]+)' , '\\1_\\2' , string_to_convert ) return re . sub ( '([a-z0-9])([A-Z])' , '\\1_\\2' , s1 ) . lower ( )
convert camelcase string to snake_case original solution in URL .