colour.utilities.slugify#
- colour.utilities.slugify(object_: Any, allow_unicode: bool = False) str[source]#
Generate a SEO friendly and human-readable slug from the specified object.
Convert to ASCII if
allow_unicodeis False. Convert spaces or repeated dashes to single dashes. Remove characters that are not alphanumerics, underscores, or hyphens. Convert to lowercase. Strip leading and trailing whitespace, dashes, and underscores.- Parameters:
- Returns:
Generated slug.
- Return type:
References
Examples
>>> slugify(" Jack & Jill like numbers 1,2,3 and 4 and silly characters ?%.$!/") 'jack-jill-like-numbers-123-and-4-and-silly-characters'