Using Python with the Twitter API to post tweets?

Ryflex picture Ryflex · Sep 30, 2013 · Viewed 11.3k times · Source

Anyone have any reccomendations as to what python library to use to post tweets to twitter?

The ones I've found are

  • twython
  • PythonTwitter
  • TwitterAPI
  • Python Twitter Tools
  • Tweepy
  • TweetPony
  • twitter-gobject

Anyone else know of any good/better ones or can anyone give me a simple example to post to twitter?

Thanks in advance - Hyflex

Answer

John Lyon picture John Lyon · Sep 30, 2013

Twython is pretty nice and is constantly updated. After the setup steps, using it is as easy as:

from twython import Twython
twitter = Twython(APP_KEY, APP_SECRET
                  OAUTH_TOKEN, OAUTH_TOKEN_SECRET)
twitter.update_status(status='See how easy using Twython is!')