I originally used the amazing Data Science Toolkit by Pete Warden, which provides a set of simple HTTP APIs, and a python library to make it even simpler. However DSTK is not local, so processing a lot of different items is very time consuming.
I learned that DSTK used a simple algorithm and a wordlist from Finn Årup Nielsen, and implemented it myself on Map World News. However, that was a little bit of work, and things have just gotten even easier:
Fast, local, sentiment analysis in Python
>>> from afinn import Afinn >>> afinn = Afinn() >>> afinn.score('This is utterly excellent!') 3.0
>>> afinn = Afinn(language='da') >>> afinn.score('Hvis ikke det er det mest afskyelige flueknepperi...') -6.0
>>> afinn = Afinn(emoticons=True) >>> afinn.score('I saw that yesterday :)') 2.0
To install AFINN, simply run
pip install afinn