videogen / utils /naming.py
evaluator42's picture
Upload 15 files
41df733 verified
raw
history blame contribute delete
140 Bytes
import re
def slugify(text: str, maxlen: int = 30) -> str:
return re.sub(r'[^a-z0-9]+', '-', (text or "").lower()).strip('-')[:maxlen]