Work in Progress...
SDK to provide an abstract and encapsulated way to comunicate and use Twitter API (in Python).
This project is available via PyPi, you just need to run this command above
$ pip install twittersdk
After installation, you can simply import in your Python project.
from twittersdk import Twitter, OAuth2Handler
authenticator = OAuth2Handler(your_consumer_key, your_secret_consumer_key)
twitter = Twitter(authenticator)
After that, you can use all twitter API requests just calling api
functions.
Return informations about a specific user timeline tweets, searched by screen_name
or user_id
.
twitter.getUserTimeline(screen_name, user_id, count=None, trim_user=None, exclude_replies=None, include_rts=None)
count
, trim_user
,exclude_replies
,include_rts
are optional arguments. You need to provide a valid screen_name
or user_id
to get filter a user timeline.
Get informations about one or more users, searched by user_id
or screen_name
.
twitter.getUsersLookup(screen_name, user_id, include_entities=None, tweet_mode=None)
Return a list of user objects or ids representing the user that who follow a specific user. screen_name
or user_id
must be provide to search by one of this data, return_type
is used to set if a return gonna be a list of ids. (search_type="ids
) or user objects(search_type="list"
).
twitter.getUserFollowers(return_type, screen_name, user_id, cursor=-1, count=None, skip_status=False, include_user_entities=False)
Return a list of user objects or ids representing the user that who a specific user follow. screen_name
or user_id
must be provide to search by one of this data, return_type
is used to set if a return gonna be a list of ids. (search_type="ids
) or user objects(search_type="list"
).
twitter.getUsersFriends(return_type, screen_name, user_id, cursor=-1, count=20, stringify_ids=False)
Returns the 20 (default) most recent Tweets liked a specified user. screen_name
or user_id
must be provide to search the tweets.
twitter.getFavorites(screen_name=None, user_id=None, count=20, since_id=None, max_id=None, include_entities=None)