Actively maintained, pure Python wrapper for the Twitter API. Supports both normal and streaming Twitter APIs
Last release 5 years ago
no release in 18 months
Release timing varies
gaps range from 3 weeks to 1.9 years
Some releases are documented
notes for 22 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
17 years old
61 releases · first in 2009
Release timeline
61 releases since 2009One column per quarter.
Releases
- 3.9.116 Jul 2021
Release notes
Open source →- Changes from raising
StopIterationto returning instead. - Updates information about Python 2.7 support drop.
- Changes from raising
- 3.9.016 Jul 2021
Nothing published for this version
- 3.8.24 Apr 2020
Nothing published for this version
- 3.8.13 Apr 2020
Nothing published for this version
- 3.8.03 Apr 2020
Release notes2 sources agree
Open source →- Bump release with latest patches from GitHub.
- Fix Direct Messages with patches from @manuelcortez.
- 3.7.07 May 2018
Release notes2 sources agree
Open source →- Fixes for cursoring API endpoints
- Improve
html_for_tweet()parsing - Documentation cleanup
- Documentation for cursor's
return_pageskeyword argument - Update links to Twitter API in documentation
- Added
create_metadataendpoint - Raise error for when cursor is not provided a callable
- 3.6.023 Aug 2017
Release notes2 sources agree
Open source →- Improve replacing of entities with links in
html_for_tweet() - Update classifiers for PyPI
- Improve replacing of entities with links in
- 3.5.06 Jun 2017
Release notes2 sources agree
Open source →- Added support for "symbols" in
Twython.html_for_tweet() - Added support for extended tweets in
Twython.html_for_tweet() - You can now check progress of video uploads to Twitter when using
Twython.upload_video()
- Added support for "symbols" in
- 3.4.030 Apr 2016
Release notes3 sources agree
Open source →- Added
upload_videoendpoint - Fix quoted status checks in
html_for_tweet - Fix
html_for_tweetmethod response when hashtag/mention is a substring of another
- Added
- 3.3.018 Jul 2015
Release notes3 sources agree
Open source →3.3.0 (2015-18-07)
- Added support for muting users
- Fix typos in documentation
- Updated documentation examples
- Added dynamic filtering to streamer
- 3.2.030 Oct 2014
Release notes2 sources agree
Open source →- PEP8'd some code
- Added
lookup_statusfunction toendpoints.py - Added keyword argument to
cursorto return full pages rather than individual results cursornow uses while loop rather than recursion- Fixed issue where Twython was unnecessarily disabling compression
- Using
responsesto mock API calls in tests - Fixed some typos in documentation
- Added
retry_afterattribute toTwythonRateLimitError - Added
upload_mediamethod toTwythonin favor ofupdate_with_media - Deprecating
update_with_mediaper Twitter API 1.1 (https://dev.twitter.com/rest/reference/post/statuses/update_with_media) - Unpin
requestsandrequests-oauthlibinrequirements.txt
- 3.1.26 Dec 2013
Release notes
Open source →3.1.2 (2013-12-05)
- Fixed Changelog (HISTORY.rst)
3.1.1 (2013-12-05)
- Update
requestsversion to 2.1.0. - Fixed: Streaming issue where
Exceptionsin handlers oron_successwhich subclassValueErrorwould previously be caught and reported as a JSON decoding problem, andon_error()would be called (with status_code=200) - Fixed issue where XML was returned when bad tokens were passed to
get_authorized_tokens - Fixed import for
setupcausing installation to fail on some devices (eg. Nokia N9/MeeGo)
3.1.0 (2013-09-25)
- Added
html_for_tweetstatic method. This method accepts a tweet object returned from a Twitter API call and will return a string with urls, mentions and hashtags in the tweet replaced with HTML. - Pass
client_argsto the streaming__init__, much like in core Twython (you can pass headers, timeout, hooks, proxies, etc.). - Streamer has new parameter
handlerswhich accepts a list of strings related to functions that are apart of the Streaming class and start with "on_". i.e. ['delete'] is passed, when 'delete' is received from a stream response;on_deletewill be called. - When an actual request error happens and a
RequestExceptionis raised, it is caught and aTwythonErroris raised instead for convenience. - Added "cursor"-like functionality. Endpoints with the attribute
iter_modewill be able to be passed toTwython.cursorand returned as a generator. Twython.search_genhas been deprecated. Please usetwitter.cursor(twitter.search, q='your_query')instead, wheretwitteris yourTwythoninstance.- Added methods
get_list_memberships,get_twitter_configuration,get_supported_languages,get_privacy_policy,get_tos - Added
auth_endpointparameter toTwython.__init__for cases when the right parameters weren't being shown during the authentication step. - Fixed streaming issue where results wouldn't be returned for streams that weren't so active (See #202 (comment))
- Streaming API now uses
_transparent_paramsso when passedTrueorFalseor an array, etc. Twython formats it to meet Twitter parameter standards (i.e. ['ryanmcgrath', 'mikehelmick', 'twitterapi'] would convert to string 'ryanmcgrath,mikehelmick,twitterapi')
- 3.1.15 Dec 2013
Release notes2 sources agree
Open source →- Update
requestsversion to 2.1.0. - Fixed: Streaming issue where
Exceptionsin handlers oron_successwhich subclassValueErrorwould previously be caught and reported as a JSON decoding problem, andon_error()would be called (with status_code=200) - Fixed issue where XML was returned when bad tokens were passed to
get_authorized_tokens - Fixed import for
setupcausing installation to fail on some devices (eg. Nokia N9/MeeGo)
- Update
- 3.1.025 Sept 2013
Release notes2 sources agree
Open source →- Added
html_for_tweetstatic method. This method accepts a tweet object returned from a Twitter API call and will return a string with urls, mentions and hashtags in the tweet replaced with HTML. - Pass
client_argsto the streaming__init__, much like in core Twython (you can pass headers, timeout, hooks, proxies, etc.). - Streamer has new parameter
handlerswhich accepts a list of strings related to functions that are apart of the Streaming class and start with "on_". i.e. ['delete'] is passed, when 'delete' is received from a stream response;on_deletewill be called. - When an actual request error happens and a
RequestExceptionis raised, it is caught and aTwythonErroris raised instead for convenience. - Added "cursor"-like functionality. Endpoints with the attribute
iter_modewill be able to be passed toTwython.cursorand returned as a generator. Twython.search_genhas been deprecated. Please usetwitter.cursor(twitter.search, q='your_query')instead, wheretwitteris yourTwythoninstance.- Added methods
get_list_memberships,get_twitter_configuration,get_supported_languages,get_privacy_policy,get_tos - Added
auth_endpointparameter toTwython.__init__for cases when the right parameters weren't being shown during the authentication step. - Fixed streaming issue where results wouldn't be returned for streams that weren't so active (See https://github.com/ryanmcgrath/twython/issues/202#issuecomment-19915708)
- Streaming API now uses
_transparent_paramsso when passedTrueorFalseor an array, etc. Twython formats it to meet Twitter parameter standards (i.e. ['ryanmcgrath', 'mikehelmick', 'twitterapi'] would convert to string 'ryanmcgrath,mikehelmick,twitterapi')
- Added
- 3.0.018 Jun 2013
Release notes2 sources agree
Open source →- Changed
twython/twython.pytotwython/api.pyin attempt to make structure look a little neater - Removed all camelCase function access (anything like
getHomeTimelineis nowget_home_timeline) - Removed
shorten_url. With therequestslibrary, shortening a URL on your own is simple enough twitter_token,twitter_secretandcallback_urlare no longer passed toTwython.__init__twitter_tokenandtwitter_secrethave been replaced withapp_keyandapp_secretrespectivelycallback_urlis now passed throughTwython.get_authentication_tokens
- Update
test_twython.pydocstrings per http://www.python.org/dev/peps/pep-0257/ - Removed
get_list_memberships, method is Twitter API 1.0 deprecated - Developers can now pass an array as a parameter to Twitter API methods and they will be automatically joined by a comma and converted to a string
endpoints.pynow containsEndpointsMixin(rather than the previousapi_tabledict) for Twython, which enables Twython to use functions declared in the Mixin.- Added OAuth 2 authentication (Application Only) for when you want to make read-only calls to Twitter without having to go through the whole user authentication ritual (see docs for usage)
- Added
obtain_access_tokento obtain an OAuth 2 Application Only read-only access token construct_api_urlnow accepts keyword arguments like other Twython methods (e.g. instead of passing{'q': 'twitter', 'result_type': 'recent'}, passq='twitter', result_type='recent')- Pass
client_argsto the Twython__init__to manipulate request variables.client_argsaccepts a dictionary of keywords and values that accepted byrequests(Session API <http://docs.python-requests.org/en/latest/api/#sessionapi>_) [ex. headers, proxies, verify(SSL verification)] and the "request" section directly below it. - Added
get_application_rate_limit_statusAPI method for returning the current rate limits for the specified source - Added
invalidate_tokenAPI method which allows registed apps to revoke an access token presenting its client credentials get_lastfunction_headernow accepts adefault_return_valueparameter. This means that if you pass a second value (ex.Twython.get_lastfunction_header('x-rate-limit-remaining', 0)) and the value is not found, it returns your default value
- Changed
- 2.10.130 May 2013
Release notes2 sources agree
Open source →- More test coverage!
- Fix
search_gen - Fixed
get_lastfunction_headerto actually do what its docstring says, returnsNoneif header is not found - Updated some internal API code,
__init__didn't need to haveself.authandself.headersbecause they were never used anywhere else but the__init__ - Added
disconnectmethod toTwythonStreamer, allowing users to disconnect as they desire - Updated
TwythonStreamErrordocstring, also allow importing it fromtwython - No longer raise
TwythonStreamErrorwhen stream line can't be decoded. Instead, sends signal toTwythonStreamer.on_error - Allow for (int, long, float) params to be passed to Twython Twitter API functions in Python 2, and (int, float) in Python 3
- 2.10.022 May 2013
Release notes2 sources agree
Open source →- Added
get_retweeters_idsmethod - Fixed
TwythonDeprecationWarningon camelCase functions if the camelCase was the same as the PEP8 function (i.e.Twython.retweetdid not change) - Fixed error message bubbling when error message returned from Twitter was not an array (i.e. if you try to retweet something twice, the error is not found at index 0)
- Added "transparent" parameters for making requests, meaning users can pass bool values (True, False) to Twython methods and we convert your params in the background to satisfy the Twitter API. Also, file objects can now be passed seamlessly (see examples in README and in /examples dir for details)
- Callback URL is optional in
get_authentication_tokensto accomedate those using OOB authorization (non web clients) - Not part of the python package, but tests are now available along with Travis CI hooks
- Added
__repr__definition for Twython, when calling only returning <Twython: APP_KEY> - Cleaned up
Twython.construct_api_url, uses "transparent" parameters (see 4th bullet in this version for explaination) - Update
requestsandrequests-oauthlibrequirements, fixing posting files AND post data together, making authenticated requests in general in Python 3.3
- Added
- 2.9.15 May 2013
Release notes2 sources agree
Open source →- "PEP8" all the functions. Switch functions from camelCase() to underscore_funcs(). (i.e.
updateStatus()is nowupdate_status())
- "PEP8" all the functions. Switch functions from camelCase() to underscore_funcs(). (i.e.
- 2.9.04 May 2013
Release notes2 sources agree
Open source →- Fixed streaming issue #144, added
TwythonStreamerto aid users in a friendly streaming experience (streaming examples inexamplesand README's have been updated as well) Twythonnow requiresrequests-oauthlib0.3.1, fixes #154 (unable to upload media when sending POST data with the file)
- Fixed streaming issue #144, added
- 2.8.029 Apr 2013
Release notes2 sources agree
Open source →- Added a
HISTORY.rstto start tracking history of changes - Updated
twitter_endpoints.pytoendpoints.pyfor cleanliness - Removed twython3k directory, no longer needed
- Added
compat.pyfor compatability with Python 2.6 and greater - Added some ascii art, moved description of Twython and
__author__to__init__.py - Added
version.pyto store the current Twython version, instead of repeating it twice -- it also had to go into it's own file because of dependencies ofrequestsandrequests-oauthlib, install would fail because those libraries weren't installed yet (on fresh install of Twython) - Removed
find_packages()fromsetup.py, only one package (we can just define it) - added quick publish method for Ryan and I:
python setup.py publishis faster to type and easier to remember thanpython setup.py sdist upload - Removed
base_urlfromendpoints.pybecause we're just repeating it inTwython.__init__ Twython.get_authentication_tokens()now takescallback_urlargument rather than passing thecallback_urlthroughTwython.__init__,callback_urlis only used in theget_authentication_tokensmethod and nowhere else (kept in init though for backwards compatability)- Updated README to better reflect current Twython codebase
- Added
warnings.simplefilter('default')line intwython.pyfor Python 2.7 and greater to display Deprecation Warnings in console - Added Deprecation Warnings for usage of
twitter_token,twitter_secretandcallback_urlinTwython.__init__ - Headers now always include the User-Agent as Twython vXX unless User-Agent is overwritten
- Removed senseless TwythonError thrown if method is not GET or POST, who cares -- if the user passes something other than GET or POST just let Twitter return the error that they messed up
- Removed conversion to unicode of (int, bool) params passed to a requests.
requestsisn't greedy about variables that can't be converted to unicode anymore - Removed
bulkUserLookup(please uselookupUserinstead), removedgetProfileImageUrl(will be completely removed from Twitter API on May 7th, 2013) - Updated shortenUrl to actually work for those using it, but it is being deprecated since
requestsmakes it easy for developers to implement their own url shortening in their app (see https://github.com/ryanmcgrath/twython/issues/184) - Twython Deprecation Warnings will now be seen in shell when using Python 2.7 and greater
- Twython now takes
ssl_verifyparameter, defaults True. Set False if you're having development server issues - Removed internal
_media_updatefunction, we could have always just usedself.post
- Added a
- 2.7.312 Apr 2013
Release notes2 sources agree
Open source →- Fixed issue where Twython Exceptions were not being logged correctly
- 2.7.28 Apr 2013
Release notes2 sources agree
Open source →- Fixed
AttributeErrorwhen trying to decode the JSON response viaResponse.json()
- Fixed
- 2.7.18 Apr 2013
Release notes2 sources agree
Open source →- Removed
simplejsondependency - Fixed
destroyDirectMessage,createBlock,destroyBlockendpoints intwitter_endpoints.py - Added
getProfileBannerSizesmethod totwitter_endpoints.py - Made oauth_verifier argument required in
get_authorized_tokens - Update
updateProfileBannerImageto use v1.1 endpoint
- Removed
- 2.7.04 Apr 2013
- 2.6.131 Mar 2013
Nothing published for this version
- 2.6.028 Mar 2013
Release notes2 sources agree
Open source →- Updated
twitter_endpoints.pyto better reflect order of API endpoints on the Twitter API v1.1 docs site
- Updated
- 2.5.52 Jan 2013
Nothing published for this version
- 2.5.414 Dec 2012
Nothing published for this version
- 2.5.31 Dec 2012
Nothing published for this version
- 2.5.211 Nov 2012
Nothing published for this version
- 2.5.19 Nov 2012
Nothing published for this version
- 2.4.012 Sept 2012
Nothing published for this version
- 2.3.324 Jul 2012
Nothing published for this version
- 2.3.229 Jun 2012
Nothing published for this version
- 2.3.129 Jun 2012
Nothing published for this version
- 2.3.024 Jun 2012
Nothing published for this version
- 2.0.123 May 2012
Nothing published for this version
- 2.0.014 May 2012
Nothing published for this version
- 1.6.010 Apr 2012
Nothing published for this version
- 1.5.224 Mar 2012
Nothing published for this version
- 1.5.121 Mar 2012
Nothing published for this version
- 1.5.021 Mar 2012
Nothing published for this version
- 1.4.615 Jan 2012
Nothing published for this version
- 1.4.526 Oct 2011
Nothing published for this version
- 1.4.46 Oct 2011
Nothing published for this version
- 1.4.310 Aug 2011
Nothing published for this version
- 1.4.230 Mar 2011
Nothing published for this version
- 1.4.126 Feb 2011
Nothing published for this version
- 1.426 Feb 2011
Nothing published for this version
- 1.3.429 Oct 2010
Nothing published for this version
- 1.3.320 Oct 2010
Nothing published for this version
- 1.3.219 Oct 2010
Nothing published for this version
- 1.3.119 Oct 2010
Nothing published for this version
- 1.317 Oct 2010
Nothing published for this version
- 1.2.114 Oct 2010
Nothing published for this version
- 1.223 Feb 2010
Nothing published for this version
- 1.017 Dec 2009
Nothing published for this version
- 0.924 Nov 2009
Nothing published for this version
- 0.828 Aug 2009
Nothing published for this version
- 0.66 Aug 2009
Nothing published for this version