graphene-django/graphene_django/utils/str_converters.py

7 lines
128 B
Python
Raw Normal View History

import re
from unidecode import unidecode
def to_const(string):
return re.sub(r"[\W|^]+", "_", unidecode(string)).upper()