reddit.front

class asyncpraw.models.Front(reddit: asyncpraw.Reddit)

Front is a Listing class that represents the front page.

__init__(reddit: asyncpraw.Reddit)

Initialize a Front instance.

best(**generator_kwargs: Union[str, int]) AsyncIterator[asyncpraw.models.Submission]

Return a ListingGenerator for best items.

Additional keyword arguments are passed in the initialization of ListingGenerator.

comments() CommentHelper

Provide an instance of CommentHelper.

For example, to output the author of the 25 most recent comments of r/test execute:

subreddit = await reddit.subreddit("test")
async for comment in subreddit.comments(limit=25):
    print(comment.author)
controversial(time_filter: str = 'all', **generator_kwargs: Union[str, int, Dict[str, str]]) AsyncIterator[Any]

Return a ListingGenerator for controversial items.

Parameters

time_filter – Can be one of: "all", "day", "hour", "month", "week", or "year" (default: "all").

Raises

ValueError if time_filter is invalid.

Additional keyword arguments are passed in the initialization of ListingGenerator.

This method can be used like:

reddit.domain("imgur.com").controversial("week")

multireddit = await reddit.multireddit("samuraisam", "programming")
multireddit.controversial("day")

redditor = await reddit.redditor("spez")
redditor.controversial("month")

redditor = await reddit.redditor("spez")
redditor.comments.controversial("year")

redditor = await reddit.redditor("spez")
redditor.submissions.controversial("all")

subreddit = await reddit.subreddit("all")
subreddit.controversial("hour")
gilded(**generator_kwargs: Union[str, int, Dict[str, str]]) AsyncIterator[Any]

Return a ListingGenerator for gilded items.

Additional keyword arguments are passed in the initialization of ListingGenerator.

For example, to get gilded items in r/test:

subreddit = await reddit.subreddit("test")
async for item in subreddit.gilded():
    print(item.id)
hot(**generator_kwargs: Union[str, int, Dict[str, str]]) AsyncIterator[Any]

Return a ListingGenerator for hot items.

Additional keyword arguments are passed in the initialization of ListingGenerator.

This method can be used like:

reddit.domain("imgur.com").hot()

multireddit = await reddit.multireddit("samuraisam", "programming")
multireddit.hot()

redditor = await reddit.redditor("spez")
redditor.hot()

redditor = await reddit.redditor("spez")
redditor.comments.hot()

redditor = await reddit.redditor("spez")
redditor.submissions.hot()

subreddit = await reddit.subreddit("all")
subreddit.hot()
new(**generator_kwargs: Union[str, int, Dict[str, str]]) AsyncIterator[Any]

Return a ListingGenerator for new items.

Additional keyword arguments are passed in the initialization of ListingGenerator.

This method can be used like:

reddit.domain("imgur.com").new()

multireddit = await reddit.multireddit("samuraisam", "programming")
multireddit.new()

redditor = await reddit.redditor("spez")
redditor.new()

redditor = await reddit.redditor("spez")
redditor.comments.new()

redditor = await reddit.redditor("spez")
redditor.submissions.new()

subreddit = await reddit.subreddit("all")
subreddit.new()
classmethod parse(data: Dict[str, Any], reddit: asyncpraw.Reddit) Any

Return an instance of cls from data.

Parameters
  • data – The structured data.

  • reddit – An instance of Reddit.

random_rising(**generator_kwargs: Union[str, int, Dict[str, str]]) AsyncIterator[asyncpraw.models.Submission]

Return a ListingGenerator for random rising submissions.

Additional keyword arguments are passed in the initialization of ListingGenerator.

For example, to get random rising submissions for r/test:

subreddit = await reddit.subreddit("test")
async for submission in subreddit.random_rising():
    print(submission.title)
rising(**generator_kwargs: Union[str, int, Dict[str, str]]) AsyncIterator[asyncpraw.models.Submission]

Return a ListingGenerator for rising submissions.

Additional keyword arguments are passed in the initialization of ListingGenerator.

For example, to get rising submissions for r/test:

subreddit = await reddit.subreddit("test")
async for submission in subreddit.rising():
    print(submission.title)
top(time_filter: str = 'all', **generator_kwargs: Union[str, int, Dict[str, str]]) AsyncIterator[Any]

Return a ListingGenerator for top items.

Parameters

time_filter – Can be one of: "all", "day", "hour", "month", "week", or "year "``(default: ``"all").

Raises

ValueError if time_filter is invalid.

Additional keyword arguments are passed in the initialization of ListingGenerator.

This method can be used like:

reddit.domain("imgur.com").top("week")

multireddit = await reddit.multireddit("samuraisam", "programming")
multireddit.top("day")

redditor = await reddit.redditor("spez")
redditor.top("month")

redditor = await reddit.redditor("spez")
redditor.comments.top("year")

redditor = await reddit.redditor("spez")
redditor.submissions.top("all")

subreddit = await reddit.subreddit("all")
subreddit.top("hour")