title: String slugification in Python
body: <p>I am in search of the best way to "slugify" string <a href="https://stackoverflow.com/questions/427102/in-django-what-is-a-slug">what "slug" is</a>, and my current solution is based on <a href="http://code.activestate.com/recipes/577257-slugify-make-a-string-usable-in-a-url-or-filename/" rel="noreferrer">this recipe</a></p>
  
  <p>I have changed it a little bit to:</p>
  
  <pre><code>s = 'String to slugify'
  
  slug = unicodedata.normalize('NFKD', s)
  slug = slug.encode('ascii', 'ignore').lower()
  slug = re.sub(r'[^a-z0-9]+', '-', slug).strip('-')
  slug = re.sub(r'[-]+', '-', slug)
  </code></pre>
  
  <p>Anyone see any problems with this code? It is working fine, but maybe I am missing something or you know a better way?</p>