Skip to content

Releases: tweepy/tweepy

4.6.0

24 Feb 21:01
e2cdc5e
Compare
Choose a tag to compare

This will be the last minor version to support Python 3.6 (#1788).

New Features / Improvements

  • Add support for streaming with Twitter API v2 (86244c1)
    • Refactor Client and Stream to inherit from new BaseClient and BaseStream classes and add StreamingClient, StreamResponse, and StreamRule
  • Add support for new max_results and pagination_token parameters for Client.get_liking_users (bdd6b55)
  • Add support for new max_results and pagination_token parameters for Client.get_retweeters (3479e56)
  • Add support for new sort_order parameter for Client.search_all_tweets (bd202e5)
  • Add support for new sort_order parameter for Client.search_recent_tweets (8b47170)
  • Add Client.get_space_tweets (c8d5d9a)
  • Add Space.subscriber_count (1ffc8cd)
  • Use repr of text in Tweet.__repr__ (4e2997e)
    • This avoids including inconstant newlines, rather than escaped newlines, in the string representation of the Tweet object, making it more consistent
  • Override Mapping.__contains__ in DataMapping (9f10a58)
    • This allows membership tests to check for existence within data in Twitter API v2 models, rather than existence of the attribute at all
  • Initialize Stream.session within Stream.__init__ (80adf5b)
    • Update the user agent based on Stream.user_agent even if Stream.session is already initialized
  • Use oauthlib to create code challenge and verifier for PKCE (eb22416)
    • Explicitly specify oauthlib dependency requirement as >= 3.2.0 (fc0d967)
      • Update requests_oauthlib dependency requirement to >= 1.2.0 (dd7e2c9)

Bug Fixes

  • Fix datetime endpoint parameter formatting in Client._make_request (#1793)

Misc

  • Remove undocumented debug function (a702325)
  • Add logging documentation (7701506)
  • Update and improve various documentation

4.5.0

25 Jan 00:53
ab27d28
Compare
Choose a tag to compare

New Features / Improvements

  • Revamp authentication interface
    • Add support for OAuth 2.0 Authorization Code Flow with PKCE
    • Rename OAuthHandler to OAuth1UserHandler (fb6eb7d)
      • OAuthHandler is kept as a deprecated alias (cba7317)
    • Rename AppAuthHandler to Oauth2AppHandler (529d793)
      • AppAuthHandler is kept as a deprecated alias (d4ceb1a)
    • Rename OAuth2Bearer to OAuth2BearerHandler (0781fde)
    • Allow passing access token and secret directly to OAuth1UserHandler.__init__ (99f3583)
      • Note, this changes the callback parameter to be the fifth argument, positionally
    • Allow OAuth2BearerHandler to be used as auth parameter for API (5a2a3fc)
    • Remove AuthHandler (d600c4c)
    • Remove OAuth1UserHandler.get_xauth_access_token (8e2de9f)
    • Update and improve authentication documentation (f9a722b)
    • Other improvements and optimizations
  • Add Client.get_me (c49cbdf, 62b5b58, f6895d3, bb87b26)
  • Add support for Media.url (#1722)
  • Use requests exception to handle JSONDecodeError (b492b0a)
    • Update requests dependency requirement to >= 2.27.0 (ed66e8e)

Bug Fixes

  • Fix Response.includes["polls"] not being Poll objects (#1733)
  • Fix Paginator handling of Client.get_all_tweets_count (#1761)

Misc

  • Improve and optimize Model.__getstate__ (#1707)
  • Add API v2 examples to documentation (bbdbb7b)
  • Update and improve various documentation

4.4.0

17 Nov 14:35
19b2033
Compare
Choose a tag to compare

New Features / Improvements

  • Add support for List lookup with Twitter API v2 (0aa2366)
  • Add Client.get_space_buyers (8bf58ca)
  • Add Space.ended_at and Space.topic_ids (c89a233)

Bug Fixes

  • Remove erroneous Space.__str__ (ebb4bfd)

4.3.0

03 Nov 22:17
ecd1ef7
Compare
Choose a tag to compare

New Features / Improvements

  • Add support for managing Tweets with Twitter API v2 (7884e3a)

Misc

  • Document HTTPException attributes (c62c31a)
  • Add table to documentation mapping Client methods to Twitter API v2 endpoints (0572b03)
  • Add and improve examples
  • Revamp examples page in documentation
  • Update and improve various documentation and tests

4.2.0

29 Oct 16:48
2b9f6ba
Compare
Choose a tag to compare

New Features / Improvements

  • Add support for managing lists with Twitter API v2 (b1342bf)
  • Rename Client.follow and Client.unfollow to Client.follow_user and Client.unfollow_user, respectively (8f8de15)
    • Client.follow and Client.unfollow are kept as deprecated aliases
  • Add FAQ section in documentation
  • Update and improve various documentation and tests

Twitter API Changes

  • Change state to optional parameter for Client.search_spaces (e61d5d6)

Bug Fixes

  • Fix parsing of datetime strings for API v2 models with Python 3.6 (5bf2446)
  • Fix models missing an API instance attribute when using Cursor with pagination by ID (451e921)

4.1.0

07 Oct 08:34
4be74f4
Compare
Choose a tag to compare

New Features / Improvements

  • Add support for Python 3.10 (229b738)
    • Update minimum dev requirement version for tox to 3.14.0
  • Add support for Spaces (5c68892)
    • Add Space model
    • Add Client.search_spaces, Client.get_spaces, and Client.get_space
  • Add support for batch compliance (6ca75e1)
    • Add Client.get_compliance_jobs, Client.get_compliance_job, and Client.create_compliance_job
  • Add Client.get_muted (00cdab8)
  • Minor documentation corrections

4.0.1

01 Oct 18:19
07fce5f
Compare
Choose a tag to compare

Bug Fixes

  • Fix handling of strings passed as fields parameters for Client methods (d61a5d9)
  • Include unexpected parameters passed to Client methods in Twitter API request (618d1c2)
    • This future-proofs for new endpoint parameters
  • Stop checking parameter names when converting parameters passed to Client methods from datetimes to strings (1320a37)
    • This future-proofs for new endpoint parameters besides start_time and end_time that accept datetimes
  • Handle simplejson being installed when handling JSONDecodeError in HTTPException (586c162)

Misc

  • Update documentation requirements (3fa38b6, 388e2f6, 4315ab0)
  • Remove nose usage from tests (b4c06a4)
  • Remove mock and nose from tests extra and requirements (0f071fd, b4c06a4)
  • Update and improve various documentation and tests

4.0.0

25 Sep 18:21
dbb37dc
Compare
Choose a tag to compare

Major New Features / Improvements

  • Support Twitter API v2 (#1472, #1535)

    • Replace API v1.1 models in package namespace
  • Rework media uploading (#640, #1486, #1501)

  • Support asynchronous streaming (#732, #1491)

  • Rework API

    • Replace bind_api and APIMethod with API.request
      • Stop using property decorators for API methods
      • Use pagination decorator
    • Add requests.Session instance as API.session attribute (2f28757)
      • Initialize a single requests.Session instance per API instance, rather than for each request
    • Log warning when API.request is passed an unexpected keyword argument that isn't an endpoint parameter (c82d7ac)
    • Rename allowed parameters (allowed_param) to endpoint parameters (endpoint_parameters) (b4fc6a0)
    • Rename methods and method parameters (see Backwards-Incompatible Changes section)
    • Require parameters for methods (see Backwards-Incompatible Changes section)
    • Stop allowing arbitrary positional arguments for methods (see Backwards-Incompatible Changes section)
    • Remove unnecessary attributes and parameters (see Backwards-Incompatible Changes section)
    • Improve, optimize, and simplify API.request and other API methods
  • Rework streaming

    • StreamListener has been merged into Stream (see Backwards-Incompatible Changes section)
    • Stream data/event handling methods (i.e. those starting with on_) now log by default and disregard return values
    • Allow the stream to disconnect when any line of data is received, including keep-alive signals (#773, #897)
    • Remove, rename, and replace attributes, methods, and parameters (see Backwards-Incompatible Changes section)
    • Improve, optimize, and simplify Stream
  • Rework documentation

    • Automatically use docstrings for documentation
    • Use NumPy style docstrings
    • Use Intersphinx linking
    • Add tooltips for cross references using sphinx-hoverxref
    • Document Stream (18a6059)
    • Document models (0724060, 78a0c22)
    • Document pagination (695d531, 652fece)
    • Add table for API documentation (6db8e4c)
    • Separate documentation for exceptions (8a831b1)
    • Move changelog to documentation (fc98629)
    • Update, improve, and organize documentation
  • Rework exceptions

Backwards-Incompatible Changes

  • Drop support for Python 2 (#1253, #1482)
  • Drop support for Python 3.5 (#1487)

API

  • Rename API and models methods
    • API.blocks -> API.get_blocks (9541794)
    • API.blocks_ids -> API.get_blocked_ids (e241ca4)
    • API.destroy_direct_message -> API.delete_direct_message (2731fc9)
      • DirectMessage.destroy -> DirectMessage.delete (2731fc9)
    • API.favorites -> API.get_favorites (3c467da)
    • API.followers -> API.get_followers (ce768d9)
    • API.followers_ids -> API.get_follower_ids (fa5e7c4)
      • models.User.followers_ids -> models.User.follower_ids (fa5e7c4)
    • API.friends -> API.get_friends (6f3fccb)
    • API.friends_ids -> API.get_friend_ids (bab3e5e)
    • API.friendships_incoming -> API.incoming_friendships (007bd07)
    • API.friendships_outgoing -> API.outgoing_friendships (1400065)
    • API.geo_search -> API.search_geo (6f4fb39)
    • API.list_direct_messages -> API.get_direct_messages (ff1186f)
    • API.list_members -> API.get_list_members (5845f02)
    • API.list_subscribers -> API.get_list_subscribers (a05b630)
    • API.lists_all -> API.get_lists (458e0e8)
    • API.lists_memberships -> API.get_list_memberships (9dddc12)
      • models.User.lists_memberships -> models.User.list_memberships (9dddc12)
    • API.lists_subscriptions -> API.get_list_subscriptions (51945a7)
      • models.User.lists_subscriptions -> models.User.list_subscriptions (51945a7)
    • API.mutes -> API.get_mutes (744edc2)
    • API.mutes_ids -> API.get_muted_ids (ea26a29)
    • API.retweeters -> API.get_retweeter_ids (588c342)
    • API.retweets -> API.get_retweets (3b3ba24)
    • API.retweets_of_me -> API.get_retweets_of_me (737bd0b)
    • API.saved_searches -> API.get_saved_searches (8b39f74)
    • API.search -> API.search_tweets (7fac253)
    • API.show_friendship -> API.get_friendship (ee9ea2e)
    • API.show_list_member -> API.get_list_member (431ab15)
    • API.show_list_subscriber -> API.get_list_subscriber (bf26301)
    • API.statuses_lookup -> API.lookup_statuses (#477)
    • API.trends_available -> API.available_trends (68b33d7)
    • API.trends_closest -> API.closest_trends (2e18162)
    • API.trends_place -> ...
Read more

3.10.0

26 Dec 02:10
29df541
Compare
Choose a tag to compare

This will be the last major and minor version to support Python 2.7 (#1253) and Python 3.5.
The next non-patch release should be version 4.0.0.

New Features / Improvements

  • Add API.search_30_day and API.search_full_archive (#1175, #1294)
  • Update allowed parameters for API.home_timeline (#1410, #1458)
    • Add trim_user, exclude_replies, include_entities
    • Remove page as erroneously documented parameter
    • Reorder count to be the first parameter
  • Update allowed parameters for API.get_oembed
    • Add hide_thread, theme, link_color, widget_type, dnt
    • Remove id
  • Remove API.update_profile_background_image (#1466)
  • Add support for Python 3.9
  • Switch from Travis CI to GitHub Actions to run tests and deploy releases (#1402)
  • Update and improve various documentation

Bug Fixes

  • Use mimetypes.guess_type as fallback for determining image file type (#1411)
  • Use proper MIME type in Content-Type header for uploaded images
  • Allow file parameter to be used again for API.media_upload (#1412, #1413)
  • Allow file parameter to be used again for API.update_profile_banner, API.update_profile_image, and API.update_with_media (#1475)
  • Fix User.lists, User.lists_memberships, and User.lists_subscriptions to retrieve information about the user in question rather than the authenticating user (#1443, #1444)

3.9.0

11 Jul 19:28
Compare
Choose a tag to compare

New Features / Improvements

  • Add API.create_media_metadata (#716)
  • Update allowed parameters for API.update_status (#1101)
    • Add exclude_reply_user_ids, attachment_url, possibly_sensitive, trim_user, enable_dmcommands, fail_dmcommands, card_uri
    • Remove in_reply_to_status_id_str, source
  • Add allowed parameters to API.get_status
    • trim_user, include_my_retweet, include_entities, include_ext_alt_text, include_card_uri
  • Add allowed parameters to API.statuses_lookup
    • include_ext_alt_text, include_card_uri
  • Improve API.lookup_users (#706)
  • Improve and optimize API.statuses_lookup, API.create_media_metadata, API.update_status
  • Add reverse as allowed parameter for API.lists_all
  • Add count as allowed parameter for API.lists_memberships
  • Add count as allowed parameter for API.lists_subscriptions
  • Add include_entities as allowed parameter for API.list_timeline
  • Add allowed parameters to API.list_subscribers
    • count, include_entities, skip_status
  • Add support for Python 3.8
  • Update and improve setup.py
  • Use requests socks extra instead of requiring PySocks directly
  • Allow uploading of images with file names without extensions (#1060, #1086)
  • Support uploading WebP images (#1298)
  • Add missing attributes to Relationship model (#1375)
  • Update max allowed size for uploaded GIFs (#1336, #1338)
  • Add _json attribute to DirectMessage model (#1342)
  • Update and improve tests (#1217)
  • Add documentation for extended Tweets
  • Document API.lookup_users (#539)
  • Add documentation for running tests (#681)
  • Add Korean translation of documentation (#1296)
  • Add Polish translation of documentation (#1316)
  • Document API.lookup_friendships (#1375)
  • Update and improve various documentation

Bug Fixes

  • Fix handling of invalid credentials for API.verify_credentials
  • Handle boolean value for API.verify_credentials include_email parameter (#890)
  • Allow Cursor to be used with API.list_direct_messages by adding DMCursorIterator (#1261, #1262)