File size: 213 Bytes
b5d1dbc
 
 
 
 
 
1
2
3
4
5
6
7
def slugify(title):
    """Lowercase ASCII slug: words joined by single hyphens, no leading or trailing hyphen."""
    import re
    slug = title.lower()
    slug = re.sub(r"[^a-z0-9]", "-", slug)
    return slug