redditwarp.siteprocs.user.SYNC#

class redditwarp.siteprocs.user.SYNC.UserProcedures(client: Client)[source]#

Bases: object

pull: Pull#

Pull submissions and comments associated with a user.

pull_subreddits: PullSubreddits#

Get user subreddits.

get_by_name(name: str) User | None[source]#

Get information about a user by name.

Returns None if the specified user was not found, or is a suspended account.

Parameters:

name (str) – User name.

Return type:

Optional[User]

fetch_by_name(name: str) User[source]#

Fetch information about a user by name.

Parameters:

name (str) – User name.

Return type:

User

Raises:
get_potentially_suspended_by_name(name: str) object | None[source]#

Get information about a potentially suspended user, by name.

Returns None if the specified user was not found.

Parameters:

name (str) –

Returns:

  • User if the user exists.

  • SuspendedUser if the user is suspended.

  • None if the user was not found.

Return type:

Optional[object]

fetch_potentially_suspended_by_name(name: str) object[source]#

Fetch information about a potentially suspended user, by name.

Parameters:

name (str) –

Returns:

Return type:

object

Raises:

redditwarp.http.exceptions.StatusCodeException

  • 404:

    The specified user was not found.

get_user_summary(idy: int | str) UserSummary | None[source]#

Get a partial user object by ID.

Parameters:

idy (Union[int, str]) –

Returns:

Return type:

Optional[UserSummary]

bulk_fetch_user_summary(ids: Iterable[_YIntOrStr]) CallChunkChainingIterator[UserSummary][source]#

Bulk fetch partial user objects, by ID.

Any ID that can’t be resolved will be ignored. Duplicate IDs in a batch will be ignored.

Parameters:

ids (Iterable[_YIntOrStr]) –

Return type:

CallChunkChainingIterator[UserSummary]

moderating(name: str) Sequence[ModeratedSubreddit][source]#

Get a list of partial subreddit objects the target user is a moderator of.

This endpoint isn’t very reliable on users with big lists.

The specified user’s own user subreddit won’t be returned, but any other user subreddit they moderate will be.

See also

p.account.pull_subreddits.moderating()

For obtaining a list of the current user’s moderated subreddits.

Parameters:

name (str) –

Return type:

Sequence[ModeratedSubreddit]

Raises:

redditwarp.http.exceptions.StatusCodeException

  • 404:

    The specified user was not found.

search(query: str, amount: int | None = None) ImpartedPaginatorChainingIterator[UserSearchPaginator, User][source]#

Search users by name or description.

Parameters:
  • query (str) –

  • amount (Optional[int]) –

Return type:

ImpartedPaginatorChainingIterator[UserSearchPaginator, User]

exists(name: str) bool[source]#

Check whether a user name exists.

Parameters:

name (str) –

Return type:

bool

Raises:

redditwarp.exceptions.RedditError

  • BAD_USERNAME:
    • The specified parameter is empty.

    • The specified username contains illegal characters.