Skip to content

Instantly share code, notes, and snippets.

@inky
Created February 13, 2009 22:28
Show Gist options
  • Save inky/64139 to your computer and use it in GitHub Desktop.
Save inky/64139 to your computer and use it in GitHub Desktop.
Flickr-style tag normalisation
import string
tag_chars = string.lowercase + string.digits
valid_char = lambda c: c in tag_chars
normalize = lambda tag: filter(valid_char, str(tag).lower())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment