qgis_deployment_toolbelt.utils.slugger module

Minimalist slugifier.

Author: Julien Moura (https://github.com/guts)

qgis_deployment_toolbelt.utils.slugger.sluggy(text_to_slugify: str, replacer: str = '-') str

Very basic slugifier using only Python Standard Library.

Parameters:
  • text_to_slugify (str) – text to slugify

  • replacer (str, optional) – char used to replace special chars. Defaults to “-“.

Example:

sample_txt = "Oyé oyé brâves gens de 1973 ! Hé oh ! Sentons-nous l'ail %$*§ ?!"
print(sluggy(sample_txt))
> oye-oye-braves-gens-de-1973-he-oh-sentons-nous-lail
Returns:

input character string stringified

Return type:

str