Multireddit#
- class praw.models.Multireddit(reddit: praw.Reddit, _data: Dict[str, Any])#
A class for users’ multireddits.
This is referred to as a “Custom Feed” on the Reddit UI.
Typical Attributes
Note
This table describes attributes that typically belong to objects of this class. PRAW dynamically provides the attributes that Reddit returns via the API. Since those attributes are subject to change on Reddit’s end, PRAW makes no effort to document any new/removed/changed attributes, other than to instruct you on how to discover what is available. As a result, this table of attributes may not be complete. See Determine Available Attributes of an Object for detailed information.
If you would like to add an attribute to this table, feel free to open a pull request.
Attribute
Description
can_editA
boolrepresenting whether or not the authenticated user may edit the multireddit.copied_fromThe multireddit that the multireddit was copied from, if it exists, otherwise
None.created_utcWhen the multireddit was created, in Unix Time.
description_htmlThe description of the multireddit, as HTML.
description_mdThe description of the multireddit, as Markdown.
display_nameThe display name of the multireddit.
nameThe name of the multireddit.
over_18A
boolrepresenting whether or not the multireddit is restricted for users over 18.subredditsA list of
Subreddits that make up the multireddit.visibilityThe visibility of the multireddit, either
"private","public", or"hidden".- __init__(reddit: praw.Reddit, _data: Dict[str, Any])#
Initialize a
Multiredditinstance.
- add(subreddit: praw.models.Subreddit)#
Add a subreddit to this multireddit.
- Parameters:
subreddit – The subreddit to add to this multi.
For example, to add r/test to multireddit
bboe/test:subreddit = reddit.subreddit("test") reddit.multireddit(redditor="bboe", name="test").add(subreddit)
- comments() CommentHelper#
Provide an instance of
CommentHelper.For example, to output the author of the 25 most recent comments of r/test execute:
for comment in reddit.subreddit("test").comments(limit=25): print(comment.author)
- controversial(*, time_filter: str = 'all', **generator_kwargs: Union[str, int, Dict[str, str]]) Iterator[Any]#
Return a
ListingGeneratorfor controversial items.- Parameters:
time_filter – Can be one of:
"all","day","hour","month","week", or"year"(default:"all").- Raises:
ValueErroriftime_filteris invalid.
Additional keyword arguments are passed in the initialization of
ListingGenerator.This method can be used like:
reddit.domain("imgur.com").controversial(time_filter="week") reddit.multireddit(redditor="samuraisam", name="programming").controversial( time_filter="day" ) reddit.redditor("spez").controversial(time_filter="month") reddit.redditor("spez").comments.controversial(time_filter="year") reddit.redditor("spez").submissions.controversial(time_filter="all") reddit.subreddit("all").controversial(time_filter="hour")
- copy(*, display_name: Optional[str] = None) praw.models.Multireddit#
Copy this multireddit and return the new multireddit.
- Parameters:
display_name – The display name for the copied multireddit. Reddit will generate the
namefield from this display name. When not provided the copy will use the same display name and name as this multireddit.
To copy the multireddit
bboe/testwith a name of"testing":reddit.multireddit(redditor="bboe", name="test").copy(display_name="testing")
- delete()#
Delete this multireddit.
For example, to delete multireddit
bboe/test:reddit.multireddit(redditor="bboe", name="test").delete()
- gilded(**generator_kwargs: Union[str, int, Dict[str, str]]) Iterator[Any]#
Return a
ListingGeneratorfor gilded items.Additional keyword arguments are passed in the initialization of
ListingGenerator.For example, to get gilded items in r/test:
for item in reddit.subreddit("test").gilded(): print(item.id)
- hot(**generator_kwargs: Union[str, int, Dict[str, str]]) Iterator[Any]#
Return a
ListingGeneratorfor hot items.Additional keyword arguments are passed in the initialization of
ListingGenerator.This method can be used like:
reddit.domain("imgur.com").hot() reddit.multireddit(redditor="samuraisam", name="programming").hot() reddit.redditor("spez").hot() reddit.redditor("spez").comments.hot() reddit.redditor("spez").submissions.hot() reddit.subreddit("all").hot()
- new(**generator_kwargs: Union[str, int, Dict[str, str]]) Iterator[Any]#
Return a
ListingGeneratorfor new items.Additional keyword arguments are passed in the initialization of
ListingGenerator.This method can be used like:
reddit.domain("imgur.com").new() reddit.multireddit(redditor="samuraisam", name="programming").new() reddit.redditor("spez").new() reddit.redditor("spez").comments.new() reddit.redditor("spez").submissions.new() reddit.subreddit("all").new()
- classmethod parse(data: Dict[str, Any], reddit: praw.Reddit) Any#
Return an instance of
clsfromdata.- Parameters:
data – The structured data.
reddit – An instance of
Reddit.
- random_rising(**generator_kwargs: Union[str, int, Dict[str, str]]) Iterator[praw.models.Submission]#
Return a
ListingGeneratorfor random rising submissions.Additional keyword arguments are passed in the initialization of
ListingGenerator.For example, to get random rising submissions for r/test:
for submission in reddit.subreddit("test").random_rising(): print(submission.title)
- remove(subreddit: praw.models.Subreddit)#
Remove a subreddit from this multireddit.
- Parameters:
subreddit – The subreddit to remove from this multi.
For example, to remove r/test from multireddit
bboe/test:subreddit = reddit.subreddit("test") reddit.multireddit(redditor="bboe", name="test").remove(subreddit)
- rising(**generator_kwargs: Union[str, int, Dict[str, str]]) Iterator[praw.models.Submission]#
Return a
ListingGeneratorfor rising submissions.Additional keyword arguments are passed in the initialization of
ListingGenerator.For example, to get rising submissions for r/test:
for submission in reddit.subreddit("test").rising(): print(submission.title)
- static sluggify(title: str)#
Return a slug version of the title.
- Parameters:
title – The title to make a slug of.
Adapted from Reddit’s utils.py.
- stream() SubredditStream#
Provide an instance of
SubredditStream.Streams can be used to indefinitely retrieve new comments made to a multireddit, like:
for comment in reddit.multireddit(redditor="spez", name="fun").stream.comments(): print(comment)
Additionally, new submissions can be retrieved via the stream. In the following example all new submissions to the multireddit are fetched:
for submission in reddit.multireddit( redditor="bboe", name="games" ).stream.submissions(): print(submission)
- top(*, time_filter: str = 'all', **generator_kwargs: Union[str, int, Dict[str, str]]) Iterator[Any]#
Return a
ListingGeneratorfor top items.- Parameters:
time_filter – Can be one of:
"all","day","hour","month","week", or"year"(default:"all").- Raises:
ValueErroriftime_filteris invalid.
Additional keyword arguments are passed in the initialization of
ListingGenerator.This method can be used like:
reddit.domain("imgur.com").top(time_filter="week") reddit.multireddit(redditor="samuraisam", name="programming").top(time_filter="day") reddit.redditor("spez").top(time_filter="month") reddit.redditor("spez").comments.top(time_filter="year") reddit.redditor("spez").submissions.top(time_filter="all") reddit.subreddit("all").top(time_filter="hour")
- update(**updated_settings: Union[str, List[Union[str, praw.models.Subreddit, Dict[str, str]]]])#
Update this multireddit.
Keyword arguments are passed for settings that should be updated. They can any of:
- Parameters:
display_name – The display name for this multireddit. Must be no longer than 50 characters.
subreddits – Subreddits for this multireddit.
description_md – Description for this multireddit, formatted in Markdown.
icon_name – Can be one of:
"art and design","ask","books","business","cars","comics","cute animals","diy","entertainment","food and drink","funny","games","grooming","health","life advice","military","models pinup","music","news","philosophy","pictures and gifs","science","shopping","sports","style","tech","travel","unusual stories","video", orNone.key_color – RGB hex color code of the form
"#FFFFFF".visibility – Can be one of:
"hidden","private", or"public".weighting_scheme – Can be one of:
"classic"or"fresh".
For example, to rename multireddit
"bboe/test"to"bboe/testing":reddit.multireddit(redditor="bboe", name="test").update(display_name="testing")