Twitter library for Python App Engine?

I am looking for a Python library that is compatible with the application engine and provides an interface for the Twitter API.

I found a python-twitter project - has anyone used it in the application engine?

+7
python google-app-engine oauth twitter
source share
3 answers

I just switched from python-twitter to tweepy . It has the best coverage, built-in OAuth and Streaming API.

Check out this fork for working with App Engine.

Edit later (thanks jmlane ): the main distribution has been fixed to work with App Engine, so get it from here .

+6
source share

Yes, you can use python-twitter in the application engine (support was added when the python-twitter 64 problem ).

+2
source share

As indicated, you can use python-twitter (in its current incarnation). To use it, just add twitter.py to your Python-GAE project, then instantiate the API:

twitter_api = twitter.Api(consumer_key=consumer_key, consumer_secret=consumer_secret, access_token_key=access_token_key, access_token_secret=access_token_secret, cache=None) 

It is important to set cache = None, as this disables internal caching, which by default uses the file system (which is not allowed in GAE). Ideally, someone should fix this in order to use memcached ... but I'm too laaazzyy ...; -)

Update: OK ... it worries ... you also need to extract the following libraries from google_appengine lib ... that you will need to explicitly add the source packages to your project, and not just reference them:

  • oauth2
  • httplib2

if you do not add them to your project, it will work locally, but not in GAE.

0
source share

All Articles