import re import unicodedata def slugify(text: str) -> str: """Slug ASCII minuscolo; preserva gli underscore (nomi tabella).""" text = unicodedata.normalize("NFKD", text).encode("ascii", "ignore").decode() return re.sub(r"[^a-z0-9_]+", "-", text.lower()).strip("-")