Some time ago Sean M. Burke wrote Text::Unidecode, a wonderful Perl module that performs Unicode transliteration. However, since I mostly write Python code at work, I kept missing an equivalent library in Python.
This is my port of Sean's module to Python. I took the most convenient path and did pretty much literal translation, with most of the work done by a simple script that converted character tables from Perl to Python syntax.
The use is pretty straight forward and it works even on more complicated cases:
from unidecode import unidecode print unidecode(u"\u5317\u4EB0") # That prints: Bei Jing
See the following URL for a list of releases:
http://code.zemanta.com/tsolc/unidecode/releasesAlternatively, you can also get the complete git repository:
$ git clone http://code.zemanta.com/tsolc/git/unidecode