title: removing accent and special characters
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/517923/what-is-the-best-way-to-remove-accents-in-a-python-unicode-string">What is the best way to remove accents in a python unicode string?</a><br>
    <a href="https://stackoverflow.com/questions/4162603/python-and-character-normalization">Python and character normalization</a>  </p>
  </blockquote>
  
  
  
  <p>I would like to remove accents, turn all characters to lowercase, and delete any numbers and special characters.</p>
  
  <p><em>Example :</em> </p>
  
  <p>Frédér8ic@ --> frederic</p>
  
  <p><em>Proposal:</em></p>
  
  <pre><code>def remove_accents(data):
      return ''.join(x for x in unicodedata.normalize('NFKD', data) if \
      unicodedata.category(x)[0] == 'L').lower()
  </code></pre>
  
  <p>Is there any better way to do this?</p>