import re import unicodedata def slugify(value: str) -> str: normalized = unicodedata.normalize("NFKD", value).encode("ascii", "ignore").decode("ascii") slug = re.sub(r"[^a-zA-Z0-9]+", "-", normalized).strip("-").lower() return slug or "sin-titulo"