Skip to content
Python Oauth client for Twitter
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Python Oauth client for Twitter

I built this so that i didn't have to keep looking for an oauth client for twitter to use in python. 

It is based off of the PHP work from ( 
It was very helpful. 

I am using the OAuth lib that is from google gdata. I figure it is a working client and is in production use - so it should be solid. You can find it at:

With a bit of modification this client should work with other publishers. 

btw, i am a python n00b. so feel free to help out. 

harper - (email and xmpp)


Google Code Project:
Issue Tracker:


The example client is included in the It is:

if __name__ == '__main__':
    consumer_key = ''
    consumer_secret = ''
    while not consumer_key:
        consumer_key = raw_input('Please enter consumer key: ')
    while not consumer_secret:
        consumer_secret = raw_input('Please enter consumer secret: ')
    auth_client = TwitterOAuthClient(consumer_key,consumer_secret)
    tok = auth_client.get_request_token()
    token = tok['oauth_token']
    token_secret = tok['oauth_token_secret']
    url = auth_client.get_authorize_url(token)
    print "Visit this URL to authorize your app: " + url
    response_token = raw_input('What is the oauth_token from twitter: ')
    response_client = TwitterOAuthClient(consumer_key, consumer_secret,token, token_secret) 
    tok = response_client.get_access_token()
    print "Making signed request"
    #verify user access
    content = response_client.oauth_request('', method='POST')
    #make an update
    #content = response_client.oauth_request('', {'status':'Updated from a python oauth client. awesome.'}, method='POST')
    print content
    print 'Done.'

You can’t perform that action at this time.