MPD Unicode
A wrapper class for python-mpd to make it return python Unicode objects.
While the mpd protocol uses utf-8 unicode, python-mpd doesn't return python unicode objects. This makes it a bit troublesome to handle strings with unicode characters in your application. Using encode/decode every time you want to evaluate a song name or artist is, to say the least, bug prone. To deal with this I made a module that subclasses python-mpd to extend its functionality.
After I made this class, some more features I felt python-mpd missed surfaced. One of these was the idle command. This command allows you to put the connection to the server in an idle state. In this state the server will inform the client of changes that might be of interest. This saves network traffic as there is no need for polling. But arguably more important, it enables the client to react to the changes immediately giving the client a nice reactive feel to it.
Later I added some other features that the original python-mpd module lacks. These are little things that could be implemented using the infrastructure already in place, such as consume and rescan.
So here it is, a lean wrapper to make the python-mpd module do the things I missed. It should make it really easy to build extensions to mpd that support Unicode and idle mode in a pretty pythonic way. It is also used in Pythagora.
view the code or download mpdunicode.