Update and improve documentation for API.retweeters
authorHarmon <Harmon758@gmail.com>
Tue, 6 Apr 2021 22:53:36 +0000 (17:53 -0500)
committerHarmon <Harmon758@gmail.com>
Tue, 6 Apr 2021 22:53:36 +0000 (17:53 -0500)
Automatically use docstring for documentation
Improve method and documentation order
Add documentation for count parameter
Improve capitalization
Improve formatting and reference

docs/api.rst
tweepy/api.py

index 71f69ff623b9840da0a84e36e0ff26d078990d38..ef35b96295fcb5646d7bf0922f186cb4d79f99d1 100644 (file)
@@ -37,6 +37,8 @@ Post, retrieve, and engage with Tweets
 
 .. automethod:: API.get_oembed
 
+.. automethod:: API.retweeters
+
 .. method:: API.retweets_of_me([since_id], [max_id], [count], [page])
 
    Returns the 20 most recent tweets of the authenticated user that have been
@@ -185,17 +187,6 @@ Status methods
    :rtype: :class:`Status` object
 
 
-.. method:: API.retweeters(id, [cursor], [stringify_ids])
-
-   Returns up to 100 user IDs belonging to users who have retweeted the Tweet
-   specified by the id parameter.
-
-   :param id: |sid|
-   :param cursor: |cursor|
-   :param stringify_ids: Have ids returned as strings instead.
-   :rtype: list of Integers
-
-
 .. method:: API.retweets(id, [count])
 
    Returns up to 100 of the first retweets of the given tweet.
index 802f32cc2debb0322c5b92492e7994fc98c5d989..895282a23524f2c9db2291e1b85292f768e6949c 100644 (file)
@@ -468,6 +468,29 @@ class API:
             ), url=url, require_auth=False, **kwargs
         )
 
+    @pagination(mode='cursor')
+    @payload('ids')
+    def retweeters(self, id, **kwargs):
+        """retweeters(id, *, count, cursor, stringify_ids)
+
+        Returns up to 100 user IDs belonging to users who have retweeted the
+        Tweet specified by the ``id`` parameter.
+
+        :param id: |sid|
+        :param count: |count|
+        :param cursor: |cursor|
+        :param stringify_ids: Have IDs returned as strings instead
+
+        :rtype: list of :class:`int`
+
+        :reference: https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/get-statuses-retweeters-ids
+        """
+        return self.request(
+            'GET', 'statuses/retweeters/ids', endpoint_parameters=(
+                'id', 'count', 'cursor', 'stringify_ids'
+            ), id=id, **kwargs
+        )
+
     @pagination(mode='id')
     @payload('status', list=True)
     def retweets_of_me(self, **kwargs):
@@ -730,17 +753,6 @@ class API:
             ), **kwargs
         )
 
-    @pagination(mode='cursor')
-    @payload('ids')
-    def retweeters(self, id, **kwargs):
-        """ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/get-statuses-retweeters-ids
-        """
-        return self.request(
-            'GET', 'statuses/retweeters/ids', endpoint_parameters=(
-                'id', 'count', 'cursor', 'stringify_ids'
-            ), id=id, **kwargs
-        )
-
     @payload('user')
     def get_user(self, **kwargs):
         """ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-users-show