Update and improve documentation for API.list_timeline
authorHarmon <Harmon758@gmail.com>
Wed, 7 Apr 2021 15:20:22 +0000 (10:20 -0500)
committerHarmon <Harmon758@gmail.com>
Wed, 7 Apr 2021 15:20:22 +0000 (10:20 -0500)
Automatically use docstring for documentation
Improve method and documentation order
Improve parameter order in documentation
Improve capitalization

docs/api.rst
tweepy/api.py

index 9cf91d927de8a5e9c9ea78623775e95b490fbe1f..b2b75ab6630089a50971f25a4436703cc0f74ff5 100644 (file)
@@ -82,6 +82,8 @@ Create and manage lists
 
 .. automethod:: API.get_list
 
+.. automethod:: API.list_timeline
+
 
 User methods
 ------------
@@ -639,29 +641,6 @@ List Methods
    :rtype: list of :class:`List` objects
 
 
-.. method:: API.list_timeline(list_id/slug, [owner_id/owner_screen_name], \
-                              [since_id], [max_id], [count], \
-                              [include_entities], [include_rts])
-
-   Returns a timeline of tweets authored by members of the specified list.
-   Retweets are included by default. Use the ``include_rts=false`` parameter to
-   omit retweets.
-
-   :param list_id: |list_id|
-   :param slug: |slug|
-   :param owner_id: |owner_id|
-   :param owner_screen_name: |owner_screen_name|
-   :param since_id: |since_id|
-   :param max_id: |max_id|
-   :param count: |count|
-   :param include_entities: |include_entities|
-   :param include_rts: A boolean indicating whether the list timeline will
-      contain native retweets (if they exist) in addition to the standard
-      stream of tweets. The output format of retweeted tweets is identical to
-      the representation you see in home_timeline.
-   :rtype: list of :class:`Status` objects
-
-
 .. method:: API.add_list_member(list_id/slug, screen_name/user_id, \
                                 [owner_id/owner_screen_name])
 
index 970bb95e057bc149b9831ce561f156bfa2389eff..0733ac996f55d6fb85acd80029970b6538018ccb 100644 (file)
@@ -1036,6 +1036,41 @@ class API:
             ), **kwargs
         )
 
+    @pagination(mode='id')
+    @payload('status', list=True)
+    def list_timeline(self, **kwargs):
+        """list_timeline(*, list_id, slug, owner_screen_name, owner_id, \
+                         since_id, max_id, count, include_entities, \
+                         include_rts)
+
+        Returns a timeline of Tweets authored by members of the specified list.
+        Retweets are included by default. Use the ``include_rts=false``
+        parameter to omit retweets.
+
+        :param list_id: |list_id|
+        :param slug: |slug|
+        :param owner_screen_name: |owner_screen_name|
+        :param owner_id: |owner_id|
+        :param since_id: |since_id|
+        :param max_id: |max_id|
+        :param count: |count|
+        :param include_entities: |include_entities|
+        :param include_rts: A boolean indicating whether the list timeline will
+            contain native retweets (if they exist) in addition to the standard
+            stream of Tweets. The output format of retweeted Tweets is
+            identical to the representation you see in home_timeline.
+
+        :rtype: list of :class:`Status` objects
+
+        :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-statuses
+                """
+        return self.request(
+            'GET', 'lists/statuses', endpoint_parameters=(
+                'list_id', 'slug', 'owner_screen_name', 'owner_id', 'since_id',
+                'max_id', 'count', 'include_entities', 'include_rts'
+            ), **kwargs
+        )
+
     def media_upload(self, filename, *, file=None, chunked=False,
                      media_category=None, additional_owners=None, **kwargs):
         """ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/media/upload-media/overview
@@ -1654,18 +1689,6 @@ class API:
             ), **kwargs
         )
 
-    @pagination(mode='id')
-    @payload('status', list=True)
-    def list_timeline(self, **kwargs):
-        """ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-statuses
-        """
-        return self.request(
-            'GET', 'lists/statuses', endpoint_parameters=(
-                'list_id', 'slug', 'owner_screen_name', 'owner_id', 'since_id',
-                'max_id', 'count', 'include_entities', 'include_rts'
-            ), **kwargs
-        )
-
     @payload('list')
     def add_list_member(self, **kwargs):
         """ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/post-lists-members-create