Skip to content

Instantly share code, notes, and snippets.

@wardi
Last active December 15, 2015 00:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wardi/5172605 to your computer and use it in GitHub Desktop.
Save wardi/5172605 to your computer and use it in GitHub Desktop.
clean up tags for ckan
# -*- coding: UTF-8 -*-
N = u"skjfhaslkdjfh lèdf&^%*sdklfjh alskjdJHGKjÄfh ()"
import re
def clean(x):
return u''.join(re.findall(u'[\w\-.]+ ?', x, re.UNICODE)).rstrip()
#...
tags = [{'name': clean(en) + u' ' + clean(fr)} for en, fr in zip(en_tags, fr_tags)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment