SubredditCollections

class praw.models.reddit.collections.SubredditCollections(reddit, subreddit, _data=None)

Class to represent a Subreddit’s Collections.

Obtain an instance via:

reddit.subreddit('SUBREDDIT').collections
__call__(collection_id=None, permalink=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 and permalink is required.

Example usage:

subreddit = reddit.subreddit('SUBREDDIT')

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, subreddit, _data=None)

Initialize an instance of SubredditCollections.

__iter__()

Iterate over the Subreddit’s Collections.

Example usage:

for collection in reddit.subreddit('SUBREDDIT').collections:
    print(collection.permalink)
mod

Get an instance of SubredditCollectionsModeration.

Provides create():

my_sub = reddit.subreddit('SUBREDDIT')
new_collection = my_sub.collections.mod.create('Title', 'desc')
classmethod parse(data, reddit)

Return an instance of cls from data.

Parameters:
  • data – The structured data.
  • reddit – An instance of Reddit.