I love regex!! solution in Clear category for Conversion from CamelCase by new_hoschi
''' find every sequence of [uppercase letter + anything different]
(i.e. split the string at the uppercase letters), turn them into lowercase
and join the different sequences with an underscore inbetween... TADAAA!!'''
return '_'.join(j.lower() for j in re.findall(r'([A-Z][^A-Z]*)',name))
April 15, 2020