Skip to content

Commit

Permalink
Change API method docstrings to raw strings
Browse files Browse the repository at this point in the history
Prevent DeprecationWarnings about invalid escape sequences
  • Loading branch information
Harmon758 committed Oct 25, 2022
1 parent 5262bf7 commit fb851a0
Showing 1 changed file with 51 additions and 51 deletions.
102 changes: 51 additions & 51 deletions tweepy/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,8 @@ def request(
@pagination(mode='next')
@payload('status', list=True)
def search_30_day(self, label, query, **kwargs):
"""search_30_day(label, query, *, tag, fromDate, toDate, maxResults, \
next)
r"""search_30_day(label, query, *, tag, fromDate, toDate, maxResults, \
next)
Premium search that provides Tweets posted within the last 30 days.
Expand Down Expand Up @@ -375,8 +375,8 @@ def search_30_day(self, label, query, **kwargs):
@pagination(mode='next')
@payload('status', list=True)
def search_full_archive(self, label, query, **kwargs):
"""search_full_archive(label, query, *, tag, fromDate, toDate, \
maxResults, next)
r"""search_full_archive(label, query, *, tag, fromDate, toDate, \
maxResults, next)
Premium search that provides Tweets from as early as 2006, starting
with the first Tweet posted in March 2006.
Expand Down Expand Up @@ -461,8 +461,8 @@ def search_full_archive(self, label, query, **kwargs):
@pagination(mode='id')
@payload('status', list=True)
def home_timeline(self, **kwargs):
"""home_timeline(*, count, since_id, max_id, trim_user, \
exclude_replies, include_entities)
r"""home_timeline(*, count, since_id, max_id, trim_user, \
exclude_replies, include_entities)
Returns the 20 most recent statuses, including retweets, posted by
the authenticating user and that user's friends. This is the equivalent
Expand Down Expand Up @@ -501,8 +501,8 @@ def home_timeline(self, **kwargs):
@pagination(mode='id')
@payload('status', list=True)
def mentions_timeline(self, **kwargs):
"""mentions_timeline(*, count, since_id, max_id, trim_user, \
include_entities)
r"""mentions_timeline(*, count, since_id, max_id, trim_user, \
include_entities)
Returns the 20 most recent mentions, including retweets.
Expand Down Expand Up @@ -536,8 +536,8 @@ def mentions_timeline(self, **kwargs):
@pagination(mode='id')
@payload('status', list=True)
def user_timeline(self, **kwargs):
"""user_timeline(*, user_id, screen_name, since_id, count, max_id, \
trim_user, exclude_replies, include_rts)
r"""user_timeline(*, user_id, screen_name, since_id, count, max_id, \
trim_user, exclude_replies, include_rts)
Returns the 20 most recent statuses posted from the authenticating user
or the user specified. It's also possible to request another user's
Expand Down Expand Up @@ -586,8 +586,8 @@ def user_timeline(self, **kwargs):
@pagination(mode='id')
@payload('status', list=True)
def get_favorites(self, **kwargs):
"""get_favorites(*, user_id, screen_name, count, since_id, max_id, \
include_entities)
r"""get_favorites(*, user_id, screen_name, count, since_id, max_id, \
include_entities)
Returns the favorite statuses for the authenticating user or user
specified by the ID parameter.
Expand Down Expand Up @@ -627,8 +627,8 @@ def get_favorites(self, **kwargs):

@payload('status', list=True)
def lookup_statuses(self, id, **kwargs):
"""lookup_statuses(id, *, include_entities, trim_user, map, \
include_ext_alt_text, include_card_uri)
r"""lookup_statuses(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.
Expand Down Expand Up @@ -759,7 +759,7 @@ def get_oembed(self, url, **kwargs):
@pagination(mode='cursor')
@payload('ids')
def get_retweeter_ids(self, id, **kwargs):
"""get_retweeter_ids(id, *, count, cursor, stringify_ids)
r"""get_retweeter_ids(id, *, count, cursor, stringify_ids)
Returns up to 100 user IDs belonging to users who have retweeted the
Tweet specified by the ``id`` parameter.
Expand Down Expand Up @@ -794,7 +794,7 @@ def get_retweeter_ids(self, id, **kwargs):

@payload('status', list=True)
def get_retweets(self, id, **kwargs):
"""get_retweets(id, *, count, trim_user)
r"""get_retweets(id, *, count, trim_user)
Returns up to 100 of the first Retweets of the given Tweet.
Expand Down Expand Up @@ -827,8 +827,8 @@ def get_retweets(self, id, **kwargs):
@pagination(mode='id')
@payload('status', list=True)
def get_retweets_of_me(self, **kwargs):
"""get_retweets_of_me(*, count, since_id, max_id, trim_user, \
include_entities, include_user_entities)
r"""get_retweets_of_me(*, count, since_id, max_id, trim_user, \
include_entities, include_user_entities)
Returns the 20 most recent Tweets of the authenticated user that have
been retweeted by others.
Expand Down Expand Up @@ -1215,8 +1215,8 @@ def update_status_with_media(self, status, filename, *, file=None,
@pagination(mode='id')
@payload('search_results')
def search_tweets(self, q, **kwargs):
"""search_tweets(q, *, geocode, lang, locale, result_type, count, \
until, since_id, max_id, include_entities)
r"""search_tweets(q, *, geocode, lang, locale, result_type, count, \
until, since_id, max_id, include_entities)
Returns a collection of relevant Tweets matching a specified query.
Expand Down Expand Up @@ -1317,7 +1317,7 @@ def search_tweets(self, q, **kwargs):

@payload('list', list=True)
def get_lists(self, **kwargs):
"""get_lists(*, user_id, screen_name, reverse)
r"""get_lists(*, user_id, screen_name, reverse)
Returns all lists the authenticating or specified user subscribes to,
including their own. The user is specified using the ``user_id`` or
Expand Down Expand Up @@ -1362,8 +1362,8 @@ def get_lists(self, **kwargs):
@pagination(mode='cursor')
@payload('user', list=True)
def get_list_members(self, **kwargs):
"""get_list_members(*, list_id, slug, owner_screen_name, owner_id, \
count, cursor, include_entities, skip_status)
r"""get_list_members(*, list_id, slug, owner_screen_name, owner_id, \
count, cursor, include_entities, skip_status)
Returns the members of the specified list.
Expand Down Expand Up @@ -1459,8 +1459,8 @@ def get_list_member(self, **kwargs):
@pagination(mode='cursor')
@payload('list', list=True)
def get_list_memberships(self, **kwargs):
"""get_list_memberships(*, user_id, screen_name, count, cursor, \
filter_to_owned_lists)
r"""get_list_memberships(*, user_id, screen_name, count, cursor, \
filter_to_owned_lists)
Returns the lists the specified user has been added to. If ``user_id``
or ``screen_name`` are not provided, the memberships for the
Expand Down Expand Up @@ -1502,7 +1502,7 @@ def get_list_memberships(self, **kwargs):
@pagination(mode='cursor')
@payload('list', list=True)
def get_list_ownerships(self, **kwargs):
"""get_list_ownerships(*, user_id, screen_name, count, cursor)
r"""get_list_ownerships(*, user_id, screen_name, count, cursor)
Returns the lists owned by the specified user. Private lists will only
be shown if the authenticated user is also the owner of the lists. If
Expand Down Expand Up @@ -1569,7 +1569,7 @@ def get_list(self, **kwargs):
@pagination(mode='id')
@payload('status', list=True)
def list_timeline(self, **kwargs):
"""list_timeline( \
r"""list_timeline( \
*, list_id, slug, owner_screen_name, owner_id, since_id, max_id, \
count, include_entities, include_rts \
)
Expand Down Expand Up @@ -1620,7 +1620,7 @@ def list_timeline(self, **kwargs):
@pagination(mode='cursor')
@payload('user', list=True)
def get_list_subscribers(self, **kwargs):
"""get_list_subscribers( \
r"""get_list_subscribers( \
*, list_id, slug, owner_screen_name, owner_id, count, cursor, \
include_entities, skip_status \
)
Expand Down Expand Up @@ -1719,7 +1719,7 @@ def get_list_subscriber(self, **kwargs):
@pagination(mode='cursor')
@payload('list', list=True)
def get_list_subscriptions(self, **kwargs):
"""get_list_subscriptions(*, user_id, screen_name, count, cursor)
r"""get_list_subscriptions(*, user_id, screen_name, count, cursor)
Obtain a collection of the lists the specified user is subscribed to,
20 lists per page by default. Does not include the user's own lists.
Expand Down Expand Up @@ -2087,8 +2087,8 @@ def update_list(self, **kwargs):
@pagination(mode='cursor')
@payload('ids')
def get_follower_ids(self, **kwargs):
"""get_follower_ids(*, user_id, screen_name, cursor, stringify_ids, \
count)
r"""get_follower_ids(*, user_id, screen_name, cursor, stringify_ids, \
count)
Returns an array containing the IDs of users following the specified
user.
Expand Down Expand Up @@ -2126,8 +2126,8 @@ def get_follower_ids(self, **kwargs):
@pagination(mode='cursor')
@payload('user', list=True)
def get_followers(self, **kwargs):
"""get_followers(*, user_id, screen_name, cursor, count, skip_status, \
include_user_entities)
r"""get_followers(*, user_id, screen_name, cursor, count, skip_status, \
include_user_entities)
Returns a user's followers ordered in which they were added. If no user
is specified by id/screen name, it defaults to the authenticated user.
Expand Down Expand Up @@ -2168,8 +2168,8 @@ def get_followers(self, **kwargs):
@pagination(mode='cursor')
@payload('ids')
def get_friend_ids(self, **kwargs):
"""get_friend_ids(*, user_id, screen_name, cursor, stringify_ids, \
count)
r"""get_friend_ids(*, user_id, screen_name, cursor, stringify_ids, \
count)
Returns an array containing the IDs of users being followed by the
specified user.
Expand Down Expand Up @@ -2207,8 +2207,8 @@ def get_friend_ids(self, **kwargs):
@pagination(mode='cursor')
@payload('user', list=True)
def get_friends(self, **kwargs):
"""get_friends(*, user_id, screen_name, cursor, count, skip_status, \
include_user_entities)
r"""get_friends(*, user_id, screen_name, cursor, count, skip_status, \
include_user_entities)
Returns a user's friends ordered in which they were added 100 at a
time. If no user is specified it defaults to the authenticated user.
Expand Down Expand Up @@ -2249,7 +2249,7 @@ def get_friends(self, **kwargs):
@pagination(mode='cursor')
@payload('ids')
def incoming_friendships(self, **kwargs):
"""incoming_friendships(*, cursor, stringify_ids)
r"""incoming_friendships(*, cursor, stringify_ids)
Returns a collection of numeric IDs for every user who has a pending
request to follow the authenticating user.
Expand Down Expand Up @@ -2280,7 +2280,7 @@ def incoming_friendships(self, **kwargs):

@payload('relationship', list=True)
def lookup_friendships(self, *, screen_name=None, user_id=None, **kwargs):
"""lookup_friendships(*, screen_name, user_id)
r"""lookup_friendships(*, screen_name, user_id)
Returns the relationships of the authenticated user to the list of up
to 100 screen_name or user_id provided.
Expand Down Expand Up @@ -2309,7 +2309,7 @@ def lookup_friendships(self, *, screen_name=None, user_id=None, **kwargs):

@payload('ids')
def no_retweets_friendships(self, **kwargs):
"""no_retweets_friendships(*, stringify_ids)
r"""no_retweets_friendships(*, stringify_ids)
Returns a collection of user_ids that the currently authenticated user
does not want to receive retweets from.
Expand All @@ -2336,7 +2336,7 @@ def no_retweets_friendships(self, **kwargs):
@pagination(mode='cursor')
@payload('ids')
def outgoing_friendships(self, **kwargs):
"""outgoing_friendships(*, cursor, stringify_ids)
r"""outgoing_friendships(*, cursor, stringify_ids)
Returns a collection of numeric IDs for every protected user for whom
the authenticating user has a pending follow request.
Expand Down Expand Up @@ -2403,7 +2403,7 @@ def get_friendship(self, **kwargs):

@payload('user', list=True)
def lookup_users(self, *, screen_name=None, user_id=None, **kwargs):
"""lookup_users(*, screen_name, user_id, include_entities, tweet_mode)
r"""lookup_users(*, screen_name, user_id, include_entities, tweet_mode)
Returns fully-hydrated user objects for up to 100 users per request.
Expand Down Expand Up @@ -2450,7 +2450,7 @@ def lookup_users(self, *, screen_name=None, user_id=None, **kwargs):
@pagination(mode='page')
@payload('user', list=True)
def search_users(self, q, **kwargs):
"""search_users(q, *, page, count, include_entities)
r"""search_users(q, *, page, count, include_entities)
Run a search for users similar to Find People button on Twitter.com;
the same results returned by people search on Twitter.com will be
Expand Down Expand Up @@ -2660,7 +2660,7 @@ def verify_credentials(self, **kwargs):

@payload('saved_search', list=True)
def get_saved_searches(self, **kwargs):
"""get_saved_searches()
r"""get_saved_searches()
Returns the authenticated user's saved search queries.
Expand Down Expand Up @@ -2974,7 +2974,7 @@ def destroy_saved_search(self, id, **kwargs):
@pagination(mode='cursor')
@payload('ids')
def get_blocked_ids(self, **kwargs):
"""get_blocked_ids(*, stringify_ids, cursor)
r"""get_blocked_ids(*, stringify_ids, cursor)
Returns an array of numeric user IDs the authenticating user is
blocking.
Expand Down Expand Up @@ -3006,7 +3006,7 @@ def get_blocked_ids(self, **kwargs):
@pagination(mode='cursor')
@payload('user', list=True)
def get_blocks(self, **kwargs):
"""get_blocks(*, include_entities, skip_status, cursor)
r"""get_blocks(*, include_entities, skip_status, cursor)
Returns an array of user objects that the authenticating user is
blocking.
Expand Down Expand Up @@ -3040,7 +3040,7 @@ def get_blocks(self, **kwargs):
@pagination(mode='cursor')
@payload('ids')
def get_muted_ids(self, **kwargs):
"""get_muted_ids(*, stringify_ids, cursor)
r"""get_muted_ids(*, stringify_ids, cursor)
Returns an array of numeric user IDs the authenticating user has muted.
Expand Down Expand Up @@ -3071,7 +3071,7 @@ def get_muted_ids(self, **kwargs):
@pagination(mode='cursor')
@payload('user', list=True)
def get_mutes(self, **kwargs):
"""get_mutes(*, cursor, include_entities, skip_status)
r"""get_mutes(*, cursor, include_entities, skip_status)
Returns an array of user objects the authenticating user has muted.
Expand Down Expand Up @@ -3286,7 +3286,7 @@ def delete_direct_message(self, id, **kwargs):
@pagination(mode='dm_cursor')
@payload('direct_message', list=True)
def get_direct_messages(self, **kwargs):
"""get_direct_messages(*, count, cursor)
r"""get_direct_messages(*, count, cursor)
Returns all Direct Message events (both sent and received) within the
last 30 days. Sorted in reverse-chronological order.
Expand Down Expand Up @@ -3944,7 +3944,7 @@ def geo_id(self, place_id, **kwargs):

@payload('place', list=True)
def reverse_geocode(self, lat, long, **kwargs):
"""reverse_geocode(lat, long, *, accuracy, granularity, max_results)
r"""reverse_geocode(lat, long, *, accuracy, granularity, max_results)
Given a latitude and a longitude, searches for up to 20 places that can
be used as a ``place_id`` when updating a status.
Expand Down Expand Up @@ -3985,7 +3985,7 @@ def reverse_geocode(self, lat, long, **kwargs):

@payload('place', list=True)
def search_geo(self, **kwargs):
"""search_geo(*, lat, long, query, ip, granularity, max_results)
r"""search_geo(*, lat, long, query, ip, granularity, max_results)
Search for places that can be attached to a Tweet via
:func:`API.update_status`. Given a latitude and a longitude pair, an IP
Expand Down

0 comments on commit fb851a0

Please sign in to comment.