server-configs/machines/gerd/services/lldap/bootstrap/utils.py

11 lines
228 B
Python
Raw Normal View History

2024-12-22 20:57:54 +00:00
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()