graphene-django/graphene_django/utils/str_converters.py
2020-12-30 10:07:13 -08:00

7 lines
133 B
Python

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