From: Harmon Date: Wed, 7 Apr 2021 16:16:52 +0000 (-0500) Subject: Update and improve documentation for API.followers_ids X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=cbe9eb32d882032e7a05b70b6e8e239759161bf8;p=tweepy.git Update and improve documentation for API.followers_ids Automatically use docstring for documentation Improve method and documentation order Add API documentation header to match API reference index Add cursor and count parameters to documentation Remove id parameter from documentation Improve parameter order in documentation --- diff --git a/docs/api.rst b/docs/api.rst index c9c4002..1e9f5b7 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -108,6 +108,11 @@ Create and manage lists .. automethod:: API.update_list +Follow, search, and get users +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. automethod:: API.followers_ids + User methods ------------ @@ -319,17 +324,6 @@ Friendship Methods :rtype: list of Integers -.. method:: API.followers_ids(id/screen_name/user_id) - - Returns an array containing the IDs of users following the specified user. - - :param id: |uid| - :param screen_name: |screen_name| - :param user_id: |user_id| - :param cursor: |cursor| - :rtype: list of Integers - - Account Methods --------------- diff --git a/tweepy/api.py b/tweepy/api.py index 8582333..352d665 100644 --- a/tweepy/api.py +++ b/tweepy/api.py @@ -1381,6 +1381,31 @@ class API: ), **kwargs ) + # Follow, search, and get users + + @pagination(mode='cursor') + @payload('ids') + def followers_ids(self, **kwargs): + """followers_ids(*, user_id, screen_name, cursor, count) + + Returns an array containing the IDs of users following the specified + user. + + :param user_id: |user_id| + :param screen_name: |screen_name| + :param cursor: |cursor| + :param count: |count| + + :rtype: list of Integers + + :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-followers-ids + """ + return self.request( + 'GET', 'followers/ids', endpoint_parameters=( + 'user_id', 'screen_name', 'cursor', 'count' + ), **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 @@ -1733,17 +1758,6 @@ class API: ), **kwargs ) - @pagination(mode='cursor') - @payload('ids') - def followers_ids(self, **kwargs): - """ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-followers-ids - """ - return self.request( - 'GET', 'followers/ids', endpoint_parameters=( - 'user_id', 'screen_name', 'cursor', 'count' - ), **kwargs - ) - @pagination(mode='cursor') @payload('user', list=True) def followers(self, **kwargs):