Possible Duplicate:
What is the best way to remove accents in a python unicode string?
Python and character normalization
I would like to remove accents, turn all characters to lowercase, and delete any numbers and special characters.
Example :
Frédér8ic@ --> frederic
Proposal:
def remove_accents(data):
return ''.join(x for x in unicodedata.normalize('NFKD', data) if \
unicodedata.category(x)[0] == 'L').lower()
Is there any better way to do this?