Update and improve documentation for API.configuration
authorHarmon <Harmon758@gmail.com>
Sun, 11 Apr 2021 20:25:29 +0000 (15:25 -0500)
committerHarmon <Harmon758@gmail.com>
Sun, 11 Apr 2021 20:25:29 +0000 (15:25 -0500)
Automatically use docstring for documentation
Improve method and documentation order
Add API documentation headers to match API reference index
Add return type to documentation

docs/api.rst
tweepy/api.py

index 4c72ccde289cc34f070ab39172dd4b897fb7152d..7aa78ad717bc3489321de6ecd07009dcf88e91d9 100644 (file)
@@ -255,6 +255,14 @@ Get places near a location
 
 .. automethod:: API.geo_search
 
+Developer utilities
+-------------------
+
+Get Twitter configuration details
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+.. automethod:: API.configuration
+
 
 Account Methods
 ---------------
@@ -368,17 +376,6 @@ Search Methods
       provided by the API, and should not be modified.
 
 
-Utility methods
----------------
-
-.. method:: API.configuration()
-
-   Returns the current configuration used by Twitter including twitter.com
-   slugs which are not usernames, maximum photo resolutions, and t.co
-   shortened URL length. It is recommended applications request this endpoint
-   when they are loaded, but no more than once a day.
-
-
 :mod:`tweepy.error` --- Exceptions
 ==================================
 
index e8b8285a9284ac4d0a5acda06fc73fe51695e787..607cffdbce5d8f596dd8b97766e4746d8e1fb381 100644 (file)
@@ -2769,6 +2769,25 @@ class API:
             ), **kwargs
         )
 
+    # Get Twitter configuration details
+
+    @payload('json')
+    def configuration(self, **kwargs):
+        """configuration()
+
+        Returns the current configuration used by Twitter including twitter.com
+        slugs which are not usernames, maximum photo resolutions, and t.co
+        shortened URL length.
+
+        It is recommended applications request this endpoint when they are
+        loaded, but no more than once a day.
+
+        :rtype: :class:`JSON` object
+
+        :reference: https://developer.twitter.com/en/docs/twitter-api/v1/developer-utilities/configuration/api-reference/get-help-configuration
+        """
+        return self.request('GET', 'help/configuration', **kwargs)
+
     @payload('json')
     def rate_limit_status(self, **kwargs):
         """ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/developer-utilities/rate-limit-status/api-reference/get-application-rate_limit_status
@@ -2806,9 +2825,3 @@ class API:
         """ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/developer-utilities/supported-languages/api-reference/get-help-languages
         """
         return self.request('GET', 'help/languages', **kwargs)
-
-    @payload('json')
-    def configuration(self, **kwargs):
-        """ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/developer-utilities/configuration/api-reference/get-help-configuration
-        """
-        return self.request('GET', 'help/configuration', **kwargs)