Created
August 3, 2017 14:49
-
-
Save JPFrancoia/e7577d602e78f15e245e6fe861b9a492 to your computer and use it in GitHub Desktop.
Slugify
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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