Document API.supported_languages
authorHarmon <Harmon758@gmail.com>
Sun, 11 Apr 2021 20:29:02 +0000 (15:29 -0500)
committerHarmon <Harmon758@gmail.com>
Sun, 11 Apr 2021 20:29:02 +0000 (15:29 -0500)
Automatically use docstring for documentation
Improve method order
Add API documentation header to match API reference index

docs/api.rst
tweepy/api.py

index 7aa78ad717bc3489321de6ecd07009dcf88e91d9..d64e87a83d403fdcd8e2b8c85d1e3eeb0ac83eb5 100644 (file)
@@ -263,6 +263,11 @@ Get Twitter configuration details
 
 .. automethod:: API.configuration
 
+Get Twitter supported languages
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+.. automethod:: API.supported_languages
+
 
 Account Methods
 ---------------
index 607cffdbce5d8f596dd8b97766e4746d8e1fb381..9f3146a60d00991d9d1de0607d5bb4b68e5c1db5 100644 (file)
@@ -2788,6 +2788,25 @@ class API:
         """
         return self.request('GET', 'help/configuration', **kwargs)
 
+    # Get Twitter supported languages
+
+    @payload('json')
+    def supported_languages(self, **kwargs):
+        """supported_languages()
+
+        Returns the list of languages supported by Twitter along with the
+        language code supported by Twitter.
+
+        The language code may be formatted as ISO 639-1 alpha-2 (``en``), ISO
+        639-3 alpha-3 (``msa``), or ISO 639-1 alpha-2 combined with an ISO
+        3166-1 alpha-2 localization (``zh-tw``).
+
+        :rtype: :class:`JSON` object
+
+        :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 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
@@ -2819,9 +2838,3 @@ class API:
                 'query', 'tag', 'fromDate', 'toDate', 'maxResults', 'next'
             ), query=query, **kwargs
         )
-
-    @payload('json')
-    def supported_languages(self, **kwargs):
-        """ :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)