server-configs/machines/gerd/services/lldap/bootstrap/utils.py
2024-12-22 21:57:54 +01:00

10 lines
228 B
Python

import re
def to_camelcase(s):
s = re.sub(r"(_|-)+", " ", s).title().replace(" ", "").replace("*", "")
return "".join([s[0].lower(), s[1:]])
def to_snakecase(s):
return re.sub(r"(?<!^)(?=[A-Z])", "_", s).lower()