I realize this is a bit of a lazyweb question, but I wanted to see which python library for Twitter people have had good experiences with.
I've used Python Twitter Tools and like its brevity and beauty of interface, but it doesn't seem to be one of the popular ones - it's not even listed on the Twitter Libraries page.
There are, however, plenty of others listed:
My requirements are fairly simple:
Twisted one aside (I'm not using twisted in this case), have you used any of the others, and if so, do you recommend them?
[Update] FWIW, I ended up going with Python Twitter Tools again. The new version supported OAuth nicely, and it's a very clever API, so I stuck to it.
Practically, if the only thing that you are looking to do is collect a large number of tweets, Twint is probably a better tool, whereas Tweepy is better suited for collecting a richer set of metadata, allows for flexibility and potentially scalability as well for those using the official API.
Tweepy is an open-sourced, easy-to-use Python library for accessing the Twitter API. It gives you an interface to access the API from your Python application. Alternatively, you can also install it from the GitHub repository.
This library provides a pure Python interface for the Twitter API. It works with Python 2.7+ and Python 3. Twitter provides a service that allows people to connect via the web, IM, and SMS. Twitter exposes a web services API and this library is intended to make it even easier for Python programmers to use.
Author: The Python-Twitter Developers < python-twitter @ googlegroups. com > This library provides a pure Python interface for the Twitter API. It works with Python 2.7+ and Python 3. Twitter provides a service that allows people to connect via the web, IM, and SMS.
I believe that twython (http://github.com/ryanmcgrath/twython) is the most full-featured and updated Twitter library out there. What are the best frameworks/libraries for someone learning Python?
As the other users have noted though, Twitter-Python doesn't have a streaming API (as far as I know), so if you need that use tweepy. Depends on what exactly you want to do. Twython is good and is regularly updated as well. Besides that, Python Tweeter should take care of most of the stuff you would want to achieve. Plus, it's easy and fun to use.
python-twitter
should cover the first four requirements. I've used it before, and it's fairly easy to start developing with it. For leveraging Twitter's streaming API, I would recommend tweetstream
. It's a fantastic Python module that grabs tweets in real-time as they are posted. Based on whether you have gardenhose/firehose access to the twitter stream, you'll only get a small fraction of tweets posted. With tweetstream, you can also provide a list of search predicates to filter specific tweets that you are looking for. I used it for a project that involved mining tweets over an 8 hour period and it worked flawlessly. Both of these modules should be available through Python's easy-install
.
EDIT: I don't know what you intend on doing with Python/Twitter but if you do plan on capturing a lot of tweets, keep in mind that Twitter receives myriad tweets in languages besides English. Remember to encode everything properly.
Full disclosure: I'm the author of Twython.
As such, I'd recommend using mine. It supports OAuth now, and ships with a skeleton Django application to get you up and running in ~5 minutes.
It can handle everything you're looking for, sans the Streaming API - I'm of the opinion that something like that should be implemented on a case-by-case basis, as it's generally a fairly custom setup. There's been very little demand for library support for it, either, so I've a hard time dedicating cycles to supporting it.
pip install twython
http://github.com/ryanmcgrath/twython
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With