Ben Delarre has written a post on setting up Spotify on his Xbian XBMC@RaspberryPi distro. He tried two alternatives, one using the Spotimc XBMC add-on and another using Mopidy. Mopidy is more of a stand-alone spotify server and is controlled remotely, e.g. via a client on your Android phone.

Spotimc is controlled via XBMC and as such requires you to have your TV/monitor turned on---at least until a remote is developed that can control. From what I can tell it was first published on the RaspBMC forums, but seemed like it worked for Xbian as well.

Mopidy required some adjusting of the XBMC installation in order to resolve library conflicts after Mopidy installation. The adjustments were simple (adding a single line in the XBMC config/path), but this may still require you to do further maintenance in later updates.

From what I can tell, both solutions employs the libspotify library already mentioned by Peter. They are also both implemented in python, and it seems the Mopidy guys has even written python bindings for libspotify, available separately on github. This might be a good starting point for others, if Mopidy does not fit their particular use-case as-is.