From aca296072d446ab88bf378fab07c01449a6793d5 Mon Sep 17 00:00:00 2001 From: Harmon Date: Tue, 6 Apr 2021 17:14:29 -0500 Subject: [PATCH] Update and improve documentation for API.statuses_lookup Automatically use docstring for documentation Update id and map parameter names in documentation Improve capitalization --- docs/api.rst | 15 +-------------- tweepy/api.py | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/docs/api.rst b/docs/api.rst index 7f71f9e..9fc6233 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -30,20 +30,7 @@ Post, retrieve, and engage with Tweets .. automethod:: API.favorites -.. method:: API.statuses_lookup(id_, [include_entities], [trim_user], [map_], \ - [include_ext_alt_text], [include_card_uri]) - - Returns full Tweet objects for up to 100 tweets per request, specified by - the ``id_`` parameter. - - :param id\_: A list of Tweet IDs to lookup, up to 100 - :param include_entities: |include_entities| - :param trim_user: |trim_user| - :param map\_: A boolean indicating whether or not to include tweets that - cannot be shown. Defaults to False. - :param include_ext_alt_text: |include_ext_alt_text| - :param include_card_uri: |include_card_uri| - :rtype: list of :class:`Status` objects +.. automethod:: API.statuses_lookup .. method:: API.retweets_of_me([since_id], [max_id], [count], [page]) diff --git a/tweepy/api.py b/tweepy/api.py index 8b6d00a..032c328 100644 --- a/tweepy/api.py +++ b/tweepy/api.py @@ -371,7 +371,23 @@ class API: @payload('status', list=True) def statuses_lookup(self, id, **kwargs): - """ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/get-statuses-lookup + """statuses_lookup(id, *, include_entities, trim_user, map, \ + include_ext_alt_text, include_card_uri) + + Returns full Tweet objects for up to 100 Tweets per request, specified + by the ``id`` parameter. + + :param id: A list of Tweet IDs to lookup, up to 100 + :param include_entities: |include_entities| + :param trim_user: |trim_user| + :param map: A boolean indicating whether or not to include Tweets + that cannot be shown. Defaults to False. + :param include_ext_alt_text: |include_ext_alt_text| + :param include_card_uri: |include_card_uri| + + :rtype: list of :class:`Status` objects + + :reference: https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/get-statuses-lookup """ return self.request( 'GET', 'statuses/lookup', endpoint_parameters=( -- 2.25.1