Skip to content

Instantly share code, notes, and snippets.

@JPFrancoia
Created August 3, 2017 14:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JPFrancoia/e7577d602e78f15e245e6fe861b9a492 to your computer and use it in GitHub Desktop.
Save JPFrancoia/e7577d602e78f15e245e6fe861b9a492 to your computer and use it in GitHub Desktop.
Slugify
def simpleChar(chaine):
"""Fct retournant la version minuscule et sans accent de la chaine
entrante"""
#http://www.siteduzero.com/forum-83-810635-p1-sqlite-recherche-avec-like-insensible-a-la-casse.html#r7767300
# Nouvelle fct de renommage, qui prend aussi les chiffres
#http://stackoverflow.com/questions/5574042/string-slugification-in-python
chaine = unidecode.unidecode(chaine).lower()
return re.sub(r'\W+', ' ', chaine)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment