9 lines
263 B
Python
9 lines
263 B
Python
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"
|