-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Twitter API v2 #1535
Merged
Support Twitter API v2 #1535
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Harmon758
added
Feature
This is regarding a new feature
API
This is regarding Twitter's API
labels
Feb 23, 2021
Fix Twitter Developer API reference links for API.get_tweet and API.get_tweets
Rename allowed_params Client._make_request parameter to endpoint_parameters
This comment has been minimized.
This comment has been minimized.
Closed
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Harmon758
added
Documentation
This is regarding the library's documentation
Tests
This is regarding the library's tests
labels
Apr 13, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
API
This is regarding Twitter's API
Documentation
This is regarding the library's documentation
Feature
This is regarding a new feature
Tests
This is regarding the library's tests
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request adds support for Twitter API v2, resolving parts of #1472, with a
Client
class and its methods:Client.hide_reply
(PUT /2/tweets/:id/hidden)Client.unhide_reply
(PUT /2/tweets/:id/hidden)Client.search_all_tweets
(GET /2/tweets/search/all)Client.search_recent_tweets
(GET /2/tweets/search/recent)Client.get_users_mentions
(GET /2/users/:id/mentions)Client.get_users_tweets
(GET /2/users/:id/tweets)Client.get_tweet
(GET /2/tweets)Client.get_tweets
(GET /2/tweets/:id)Client.unfollow
(DELETE /2/users/:source_user_id/following/:target_user_id)Client.get_users_followers
(GET /2/users/:id/followers)Client.get_users_following
(GET /2/users/:id/following)Client.follow
(POST /2/users/:id/following)Client.get_user
(GET /2/users/:id, GET /2/users/by/username/:username)Client.get_users
(GET /2/users, GET /2/users/by)New API v2 models have been added:
Media
Place
Poll
ReferencedTweet
Tweet
User
replacing API v1.1 models (which can still be accessed through
tweepy.models
) in the package namespace.A
Paginator
has also been added for use withClient
methods.This PR also includes documentation and tests for
Client
, as well as documentation forPaginator
and the new models.Currently, this is in a very preliminary rough draft state, and many parts of this initial implementation might change before this pull request is complete. I wanted to get this branch and draft pull request out as soon as possible, as there have been requests to do so (e.g. by @sparack and others) and so that anyone can test Twitter API v2 and provide feedback on Tweepy's interface for it.Note, there is still planned functionality missing in this initial implementation, such as error and rate limit handling, a pagination interface, and methods for the newest manage follows endpoints.Documentation and tests also have not been added yet.
I'm also still considering how to expose
tweepy.user.User
, so as not to conflict with the API v1.1User
object/model.