SubredditCollections
- class praw.models.reddit.collections.SubredditCollections(reddit: praw.Reddit, subreddit: praw.models.Subreddit, _data: Optional[Dict[str, Any]] = None)
Class to represent a
Subreddit
’sCollection
s.Obtain an instance via:
reddit.subreddit("test").collections
- __call__(collection_id: Optional[str] = None, permalink: Optional[str] = None)
Return the
Collection
with the specified ID.- Parameters
collection_id – The ID of a
Collection
(default:None
).permalink – The permalink of a collection (default:
None
).
- Returns
The specified
Collection
.
Exactly one of
collection_id
orpermalink
is required.Example usage:
subreddit = reddit.subreddit("test") uuid = "847e4548-a3b5-4ad7-afb4-edbfc2ed0a6b" collection = subreddit.collections(uuid) print(collection.title) print(collection.description) permalink = "https://www.reddit.com/r/SUBREDDIT/collection/" + uuid collection = subreddit.collections(permalink=permalink) print(collection.title) print(collection.description)
- __init__(reddit: praw.Reddit, subreddit: praw.models.Subreddit, _data: Optional[Dict[str, Any]] = None)
Initialize a
SubredditCollections
instance.
- __iter__()
Iterate over the
Subreddit
’sCollection
s.Example usage:
for collection in reddit.subreddit("test").collections: print(collection.permalink)
- mod() praw.models.reddit.collections.SubredditCollectionsModeration
Get an instance of
SubredditCollectionsModeration
.Provides
create()
:my_sub = reddit.subreddit("test") new_collection = my_sub.collections.mod.create(title="Title", description="desc")