WikiPage¶
- class praw.models.reddit.wikipage.WikiPage(reddit, subreddit, name, revision=None, _data=None)¶
An individual
WikiPageobject.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
content_htmlThe contents of the wiki page, as HTML.
content_mdThe contents of the wiki page, as Markdown.
may_reviseA
boolrepresenting whether or not the authenticated user may edit the wiki page.nameThe name of the wiki page.
revision_byThe
Redditorwho authored this revision of the wiki page.revision_dateThe time of this revision, in Unix Time.
subredditThe
Subredditthis wiki page belongs to.- Parameters:
reddit (praw.Reddit)
subreddit (models.Subreddit)
name (str)
revision (str | None)
- discussions(**generator_kwargs)¶
Return a
ListingGeneratorfor discussions of a wiki page.Discussions are site-wide links to a wiki page.
Additional keyword arguments are passed in the initialization of
ListingGenerator.To view the titles of discussions of the page
"praw_test"in r/test, try:for submission in reddit.subreddit("test").wiki["praw_test"].discussions(): print(submission.title)
- Return type:
- Parameters:
generator_kwargs (Any)
- edit(*, content, reason=None, **other_settings)¶
Edit this wiki page’s contents.
- Parameters:
- Return type:
For example, to replace the first wiki page of r/test with the phrase
"test wiki page":page = next(iter(reddit.subreddit("test").wiki)) page.edit(content="test wiki page")
- mod()¶
Provide an instance of
WikiPageModeration.For example, to add u/spez as an editor on the wikipage
"praw_test"try:reddit.subreddit("test").wiki["praw_test"].mod.add("spez")
- Return type:
- classmethod parse(data, reddit)¶
Return an instance of
clsfromdata.
- revision(revision)¶
Return a specific version of this page by revision ID.
To view revision
"1234abc"of"praw_test"in r/test:page = reddit.subreddit("test").wiki["praw_test"].revision("1234abc")
- revisions(**generator_kwargs)¶
Return a
ListingGeneratorfor page revisions.Additional keyword arguments are passed in the initialization of
ListingGenerator.To view the wiki revisions for
"praw_test"in r/test try:for item in reddit.subreddit("test").wiki["praw_test"].revisions(): print(item)
To get
WikiPageobjects for each revision:for item in reddit.subreddit("test").wiki["praw_test"].revisions(): print(item["page"])