Change Log#
PRAW follows semantic versioning.
7.7.1 (2023/07/11)#
Fixed
An issue with replying to a modmail conversation results in a error.
7.7.0 (2023/02/25)#
Added
delete_mobile_banner()to delete mobile banners.upload_mobile_banner()to upload mobile banners.Experimental
_edit_experimental()for adding new inline media or editing a submission that has inline media.Danger
This method is experimental. It is reliant on undocumented API endpoints and may result in existing inline media not displaying correctly and/or creating a malformed body. Use at your own risk. This method may be removed in the future without warning.
This method is identical to
Submission.edit()except for the following:The ability to add inline media to existing posts.
Additional
preserve_inline_mediakeyword argument to allow PRAW to attempt to preserve the existing inline media when editing a post. This is an experimental fix for an issue that occurs when editing a post with inline media would cause the media to lose their inline appearance.
Fixed
An issue with iterating
ModNotewhen a user has more than a hundred notes.Removal reasons are now returned in the same order as they appear on Reddit.
7.6.1 (2022/11/11)#
Changed
Revert
edit()positional argument deprecation.Revert
reply()positional argument deprecation.Revert
reply()positional argument deprecation.Revert
edit()positional argument deprecation.Revert
reply()positional argument deprecation.
Fixed
An issue where
ModmailConversation’smessagesattribute would only contain the latest message.
7.6.0 (2022/05/10)#
Added
pin()to manage pinned submissions on the authenticated user’s profile.update_display_layout()to update the display layout of posts in aCollection.SubredditCollectionsModeration.create()keyword argumentdisplay_layoutfor specifying a display layout when creating aCollection.ModNoteto represent a moderator note.ModNote.delete()to delete a single moderator note.RedditModNotesto interact with moderator notes from aRedditinstance. This provides the ability to create and fetch notes for one or more redditors from one or more subreddits.RedditorModNotesto interact with moderator notes from aRedditorinstance.RedditorModNotes.subreddits()to obtain moderator notes from multiple subreddits for a single redditor.SubredditModNotesto interact with moderator notes from aSubredditinstance.SubredditModNotes.redditors()to obtain moderator notes for multiple redditors from a single subreddit.create()to create a moderator note.Redditor.notesto interact withRedditorModNotes.SubredditModeration.notesto interact withSubredditModNotes.create_note()create a moderator note from aCommentorSubmission.author_notes()to view the moderator notes for the author of aCommentorSubmission.
Changed
Drop support for Python 3.6, which is end-of-life on 2021-12-23.
conversations()now returns aListingGeneratorallowing you to page through more than 100 conversations.
Deprecated
The
afterargument forconversations()will now have to be included inparamskeyword argument.Positional keyword arguments for applicable functions and methods. Starting with PRAW 8, most functions and methods will no longer support positional arguments. It will encourage more explicit argument passing, enable arguments to be sorted alphabetically, and prevent breaking changes when adding new arguments to existing methods.
7.5.0 (2021/11/13)#
Added
Log a warning if a submission’s
comment_sortattribute is updated after the submission has already been fetched and awarn_comment_sortconfig setting to turn off the warning.user_selectable()to get available subreddit link flairs.Automatic RateLimit handling will support errors with millisecond resolution.
Fixed
An import error when using PRAW in environments where
libsqlite3-devis needed to utilize thesqlite3builtin.Fixed bug where some keyword arguments that are passed to
Draft.submit()would not have an effect.
7.4.0 (2021/07/30)#
Added
discussions()to obtain site-wide link submissions that link to the WikiPage.revert()to revert a WikiPage to a specified revision.Inbox.mark_all_read()to mark all messages as read with one API call.unblock_subreddit()to unblock a subreddit.update_crowd_control_level()to update the crowd control level of a post.moderator_subreddits(), which returns information about the subreddits that the authenticated user moderates, has been restored.The configuration setting
refresh_tokenhas been added back. See https://www.reddit.com/r/redditdev/comments/olk5e6/followup_oauth2_api_changes_regarding_refresh/ for more info.Draftto represent a submission draft.Draft.delete()to delete drafts.Draft.submit()to submit drafts.Draft.update()to modify drafts.DraftHelperto fetch or create drafts on new Reddit.
Changed
Reddit.delete()now accepts theparamsparameter.
Deprecated
Redditkeyword argumenttoken_manager.
7.3.0 (2021/06/17)#
Added
UserSubredditfor thesubredditattribute ofRedditor.username_available()checks if a username is available.trusted()to retrieve aRedditorListof trusted users.trust()to add a user to the trusted list.distrust()to remove a user from the trusted list.SQLiteTokenManager(may not work on Windows).
Changed
moderated()will now objectify all data returned from the API.The
wiki_editendpoint has been changed fromr/{subreddit}/api/wiki/edit/tor/{subreddit}/api/wiki/edit.Redditor.block()no longer needs to retrieve a user’s fullname.
Deprecated
The
subredditattribute ofRedditoris no longer a dict.Legacy modmail is slated for deprecation by Reddit in June 2021. See https://www.reddit.com/r/modnews/comments/mar9ha/even_more_modmail_improvements/ for more info.
Fixed
Fixed bug where
WikiPage.edit()andSubredditWiki.create()would fail if passedcontentandreasonparameters that produced a request with a body greater than 500 KiB, even when the parameters did not exceed their respective permitted maximum lengths.Fixed bug where
request()could not handle instances ofBadRequests when the JSON data contained only the keys “reason” and “message”.Fixed bug where
request()could not handle instances ofBadRequests when the response did not contain valid JSON data.Fixed bug where
fullname()sometimes returned the wrong fullname.
7.2.0 (2021/02/24)#
Added
Redditkeyword argumenttoken_manager.FileTokenManagerand its parent abstract classBaseTokenManager.
Deprecated
The configuration setting
refresh_tokenis deprecated and its use will result in aDeprecationWarning. This deprecation applies in all ways of setting configuration values, i.e., viapraw.ini, as a keyword argument when initializing an instance ofReddit, and via thePRAW_REFRESH_TOKENenvironment variable. To be prepared for PRAW 8, use the newRedditkeyword argumenttoken_manager. See Working with Refresh Tokens in PRAW’s documentation for an example.me()will no longer returnNonewhen called inread_onlymode starting in PRAW 8. ADeprecationWarningwill be issued. To switch forward to the PRAW 8 behavior setpraw8_raise_exception_on_me=Truein yourRedditcall.
7.1.4 (2021/02/07)#
Fixed
Asynchronous check will no longer fail in Python 3.6 multithreading edge cases.
7.1.3 (2021/02/05)#
Changed
Asynchronous check will no longer occur when in a Jupyter notebook.
7.1.2 (2021/02/03)#
Fixed
Asynchronous check would not work on Python 3.6 as
get_running_loop()only exists on Python 3.7+.
7.1.1 (2021/02/02)#
Added
Add method
Subreddits.premium()to reflect the naming change in Reddit’s API.Ability to submit image galleries with
submit_gallery().Ability to pass a gallery url to
Reddit.submission().Ability to specify modmail mute duration.
Add method
invited()to get invited moderators of a subreddit.Ability to submit text/self posts with inline media.
Add method
Submission.award()andComment.award()with the ability to specify type of award, anonymity, and message when awarding a submission or comment.Ability to specify subreddits by name using the subreddits parameter in
Reddit.info().A check to see if PRAW is running in an asynchronous environment and will advise the user to use Async PRAW. This also adds a configuration option to disable the check.
Changed
Drop support for Python 3.5, which is end-of-life on 2020-09-13.
BoundedSetwill now utilize a Last-Recently-Used (LRU) storing mechanism, which will change the order in which elements are removed from the set.Improved
submit_image()andsubmit_video()performance in slow network environments by removing a race condition when establishing a websocket connection.
Deprecated
Subreddits.gold()is superseded bySubreddits.premium().Submission.gild()is superseded bySubmission.award().Comment.gild()is superseded byComment.award().
Fixed
An issue where leaving as a moderator fails if you are using token auth.
An issue where an incorrect error was being raised due to invalid submission urls.
Some cases where streams yield the same item multiple times. This cannot be prevented in every case.
7.1.0 (2020/06/22)#
Added
Ruleto represent one rule of a subreddit.SubredditRulesto get and add rules.Ability to submit polls with
submit_poll().PollDataandPollOption.Ability to view poll data and poll options via the
.poll_dataattribute on poll submissions.Add method
delete()toRedditclass to support HTTP DELETE requests.Added
CalendarConfigurationto represent the configuration of aCalendarwidget.Added
Stylesto represent widget styling information.Ability to stream live thread updates via new class
LiveThreadStreamwith methodupdates().
Changed
RemovalReason.update()’s parameters are now optional.SubredditRemovalReasons.__getitem__()now takes integers and slices to get removal reasons from the list of reasons as returned by Reddit.
Deprecated
WebSocketException.original_exceptionis deprecated and slated for removal in PRAW 8.0.
Fixed
An issue where certain subreddit settings could not be set through
SubredditModeration.update(), such aswelcome_message_enabledandwelcome_message_text. This change also removes the need for PRAW to track current subreddit settings and send unmodified ones in the update request.Instances of
BadRequests captured by PRAW that do not contain any detailed JSON data are re-raised as the originalBadRequest.submit_image()andsubmit_video()will throwMediaPostFailedwhen Reddit fails to post an image or video post.
7.0.0 (2020/04/24)#
Added
config_interpolationparameter forRedditsupporting basic and extended modes.Add
partial_redditors()that returns lightweight redditor objects that contain only a few fields. This is useful for resolvingRedditorIDs to their usernames in bulk.User.friends()has a new parameteruserthat takes either an instance ofRedditoror a string containing a redditor name and returns an instance ofRedditorif the authenticated user is friends with the user, otherwise throws an exception.SubmissionModeration.flair()has the parameterflair_template_idfor applying flairs with template IDs.Emoji.update()supports modifying an emoji’s permissions.SubredditEmoji.add()now supports optionally passing booleans to set an emoji’s permissions upon upload.Methods
SubredditLinkFlairTemplates.update()andSubredditRedditorFlairTemplates.update()contain a new parameter,fetch, that toggles the automatic fetching of existing data from Reddit. It is set to True by default.Values in methods
SubredditLinkFlairTemplates.update()andSubredditRedditorFlairTemplates.update()that are left as the defaults will no longer be over-written if thefetchparameter is set toTrue, but will fill in existing values for the flair template.The parameter
textfor methodsSubredditLinkFlairTemplates.update()andSubredditRedditorFlairTemplates.update()is no longer required.There is a new method,
post_requirements(), to fetch a subreddit’s post requirements.Method
SubmissionModeration.sticky()will now ignore the Conflict exception generated by trying to sticky the same post multiple times.A new method
CommentModeration.show()will uncollapse a comment that was collapsed because of Crowd ControlMethods
submit_image()andsubmit_video()will throwTooLargeMediaExceptionif the submitted media is rejected by Reddit due to the size of the media.Class
Reddithas an attribute,validate_on_submit, that can be set after class initialization that causes methodssubmit(),submit_image(),submit_video(), andSubmission.edit()to check that the submission matches a subreddit’s post validation rules. This attribute will be functionally useless once Reddit implements their change. This attribute will be deprecated on the next release after Reddit’s change, and will be removed on the next major release after Reddit’s change.
Warning
In May-June 2020, Reddit will force all submissions to run through a subreddit’s validation rules.
Introduced a data class,
RedditErrorItem, to represent an individual error item returned from Reddit.Class
RedditAPIExceptionnow serves as a container for theRedditErrorItems. You can access the items by doingRedditAPIException.items, which returns a list.APIExceptionis an alias toRedditAPIException.Parameter
discussion_typeto methodssubmit(),submit_image(), andsubmit_video()to support submitting as a live discussion (set to"CHAT").Instances of
Trophycan be compared for equality with each other.Reddithas a new configurable parameter,timeout. This defaults to 16 seconds. It controls how long PRAW will wait for a response before throwing an exception.PRAW now handles ratelimit errors returned as instances of
RedditAPIException.Reddithas one new parameter,ratelimit_seconds. The parameter configures the maximum amount of seconds to catch ratelimits for. It defaults to 5 seconds when not specified.
Changed
prawcore.BadRequestshould no longer be raised. Instead, a more usefulRedditAPIExceptioninstance will be raised.Set the default comment sort to
confidenceinstead ofbestbecause it turns outbestisn’t actually the correct value for the parameter.
Deprecated
APIExceptionis deprecated and slated for removal in PRAW 8.0.
Fixed
SubredditFlair.update()will not error out when the flair text contains quote marks.
Removed
Converting
APIExceptionto string will no longer escape unicode characters.Module
praw.models.modactionno longer exists. Please use the modulepraw.models.mod_action, or directly importModActionfrompraw.models.Methods
SubredditLinkFlairTemplates.update()andSubredditRedditorFlairTemplates.update()will no longer create flairs that are using an invalid template id, but instead throw aInvalidFlairTemplateID.Method
reddit.user.moderator_subredditshas been removed. Please usemoderated()instead.
6.5.1 (2020/01/07)#
Fixed
Removed usages of
NoReturnthat caused PRAW to fail due toImportErrorin Python<3.5.4and<3.6.2.
6.5.0 (2020/01/05)#
Added
set_original_content()supports marking a submission as original content.unset_original_content()supports unmarking a submission as original content.moderated()to get a list of a redditor’s moderated subreddits.Parameter
without_websocketstosubmit_image()andsubmit_video()to submit without using WebSockets.Reddit.redditor()supportsfullnameparam to fetch aRedditorby the fullname instead of name.Redditorconstructor now also hasfullnameparam.Add
RemovalReasonandSubredditRemovalReasonsto work with removal reasonsAttribute
removal_reasonstoSubredditModerationto interact with new removal reason classesParameters
mod_noteandreason_idtoremove()to optionally apply a removal reason on removalAdd
SubredditModerationStreamto enable moderation streamsAttribute
streamtoSubredditModerationto interact with new moderation streamsAdd
edited()to allow streaming ofSubredditModeration.edited()Add
log()to allow streaming ofSubredditModeration.log()Add
modmail_conversations()to allow streaming ofModmail.conversations()Add
modqueue()to allow streaming ofSubredditModeration.modqueue()Add
reports()to allow streaming ofSubredditModeration.reports()Add
spam()to allow streaming ofSubredditModeration.spam()Add
unmoderated()to allow streaming ofSubredditModeration.unmoderated()Add
unread()to allow streaming ofSubredditModeration.unread()Parameter
exclude_beforetostream_generator()to allowmodmail_conversations()to workParameters
allowable_contentandmax_emojistoadd(),add(), andupdate(), as well as its child classes.
Deprecated
Method
reddit.user.moderator_subredditsasmoderated()provides more functionality.The file for ModActions (
praw/models/modaction.py) has been moved topraw/models/mod_action.pyand the previous has been deprecated.
Expected Changes
The behavior of
APIExceptionwill no longer unicode-escape strings in the next minor release.
6.4.0 (2019/09/21)#
Added
crosspost()support parameterflair_idto flair the submission immediately upon crossposting.crosspost()support parameterflair_textto set a custom text to the flair immediately upon crossposting.crosspost()support parameternsfwto mark the submission NSFW immediately upon crossposting.crosspost()support parameterspoilerto mark the submission as a spoiler immediately upon crossposting.
Fixed
add_community_list()has parameterdescriptionto support unannounced upstream Reddit API changes.WidgetModeration.update()supports passing a list ofSubredditobjects.
Changed
Removed
css_classparameter cannot be used withbackground_color,text_color, ormod_onlyconstraint on methods:SubredditFlairTemplates.update()SubredditRedditorFlairTemplates.add()SubredditLinkFlairTemplates.add()
Removed
Drop official support for Python 2.7.
Multireddit.rename()no longer works due to a change in the Reddit API.
6.3.1 (2019/06/10)#
Removed
SubredditListingMixin.gilded(), as this was supposed to be removed in 6.0.0 after deprecation in 5.2.0.
6.3.0 (2019/06/09)#
Added
Collections (
Collectionand helper classes).submit(),submit_image(), andsubmit_video()can be used to submit a post directly to a collection.praw.util.camel_to_snakeandpraw.util.snake_case_keys.Comments can now be locked and unlocked via
comment.mod.lock()andcomment.mod.unlock(). See: (lock()andunlock()).alignparameter toupload_banner_additional_image()
Changed
Reddit.info()now accepts any non-str iterable for fullnames (not justlist).Reddit.info()now returns a generator instead of a list when using theurlparameter.
6.2.0 (2019/05/05)#
Added
submit(),submit_image(), andsubmit_video()support parameternsfwto mark the submission NSFW immediately upon posting.submit(),submit_image(), andsubmit_video()support parameterspoilerto mark the submission as a spoiler immediately upon posting.submit_image()andsubmit_video()support parametertimeout. Default timeout has been raised from 2 seconds to 10 seconds.Added parameter
function_kwargstostream_generator()to pass additional kwargs tofunction.
Fixed
Subreddit.random()returnsNoneinstead of raisingClientExceptionwhen the subreddit does not support generating random submissions.
Other
Bumped minimum prawcore version to 1.0.1.
6.1.1 (2019/01/29)#
Added
SubredditFlair.set()supports parameterflair_template_idfor giving a user redesign flair.
6.1.0 (2019/01/19)#
Added
Add method
Redditor.trophies()to get a list of the Redditor’s trophies.Add class
PostFlairWidget.Add attributes
reply_limitandreply_sortto classCommentAdd class
SubredditWidgetsModeration(accessible throughSubredditWidgets.mod) and methodadd_text_area().Add class
WidgetModeration(accessible through the.modattribute on any widget) with methodsupdate()anddelete().Add method
Reddit.put()for HTTP PUT requests.Add methods
add_calendar()andadd_community_list().Add methods
add_image_widget()andupload_image().Add method
add_custom_widget().Add method
add_post_flair_widget().Add method
add_menu().Add method
add_button_widget().Add method
reorder()to reorder a subreddit’s widgets.Add
Redditors(reddit.redditors) to provideRedditorlistings.Add
submit_image()for submitting native images to Reddit.Add
submit_video()for submitting native videos and videogifs to Reddit.
Changed
SubredditLinkFlairTemplates.__iter__()uses the v2 flair API endpoint. This change will result in additional fields being returned. All fields that were previously returned will still be returned.SubredditRedditorFlairTemplates.__iter__()uses the v2 flair API endpoint. The method will still return the exact same items.Methods
SubredditRedditorFlairTemplates.add(),SubredditLinkFlairTemplates.add(),SubredditRedditorFlairTemplates.update(), andSubredditLinkFlairTemplates.update()can add and update redesign-style flairs with the v2 flair API endpoint. They can still update pre-redesign-style flairs with the older endpoint.
Fixed
Widgets of unknown types are parsed as
Widgets rather than raising an exception.
6.0.0 (2018/07/24)#
Added
Add method
revision()to get a specific wiki page revision.Added parameter
skip_existingtostream_generator()to skip existing items when starting a stream.Add method
Front.best()to get the front page “best” listing.Add
Subreddit.widgets,SubredditWidgets, and widget subclasses likeTextAreato support fetching Reddit widgets.Add method
Submission.mark_visited()to mark a submission as visited on the Reddit backend.
Fixed
Fix
RecursionErroronSubredditEmoji’sreprandstr.SubredditFilters.add()andSubredditFilters.remove()also accept aSubredditfor thesubredditparameter.Remove restriction which prevents installed (non-confidential) apps from using OAuth2 authorization code grant flow.
Removed
Subreddit.submissionsas the API endpoint backing the method is no more. See https://www.reddit.com/r/changelog/comments/7tus5f/update_to_search_api/.
5.4.0 (2018/03/27)#
Added
Add method
patch()toRedditclass to support HTTP PATCH requests.Add class
Preferencesto access and update Reddit preferences.Add attribute
User.preferencesto access an instance ofPreferences.Add method
Message.delete().Add class
Emojito work with custom subreddit emoji.
Deprecated
Subreddit.submissionsas the API endpoint backing the method is going away. See https://www.reddit.com/r/changelog/comments/7tus5f/update_to_search_api/.
Fixed
Fix bug with positive
pause_aftervalues in streams provided bystream_generator()where the wait time was not reset after a yieldedNone.Parse URLs with trailing slashes and no
"comments"element when creatingSubmissionobjects.Fix bug where
Subreddit.submissionsreturns a same submission more than onceFix bug where
ListingGeneratorfetches the same batch of submissions in an infinite loop when"before"parameter is provided.
Removed
Removed support for Python 3.3 as it is no longer supported by requests.
5.3.0 (2017/12/16)#
Added
Multireddit.stream, to stream submissions and comments from a multireddit.
Fixed
Now raises
prawcore.UnavailableForLegalReasonsinstead of anAssertionErrorwhen encountering a HTTP 451 response.
5.2.0 (2017/10/24)#
Changed
An attribute on
LiveUpdatenow works as lazy attribute (i.e., populate an attribute when the attribute is first accessed).
Deprecated
subreddit.comments.gildedbecause there isn’t actually an endpoint that returns only gilded comments. Usesubreddit.gildedinstead.
Fixed
Removed
comment.permalink()becausecomment.permalinkis now an attribute returned by Reddit.
5.1.0 (2017/08/31)#
Added
Redditor.stream, with methodsRedditorStream.submissions()andRedditorStream.comments()to stream a Redditor’s comments or submissionsRedditorStreamhas been added to facilitateRedditor.streamInbox.collapse()to mark messages as collapsed.Inbox.uncollapse()to mark messages as uncollapsed.Raise
ClientExceptionwhen callingComment.refresh()when the comment does not appear in the resulting comment tree.Submission.crosspost()to crosspost to a subreddit.
Fixed
Calling
Comment.refresh()on a directly fetched, deeply nestedCommentwill additionally pull in as many parent comments as possible (currently 8) enabling significantly quicker traversal to the top-mostCommentvia successiveparent()calls.Calling
refresh()previously could have resulted in aAttributeError: "MoreComments" object has no attribute "_replies"exception. This situation will now result in aClientException.Properly handle
BAD_CSS_NAMEerrors when uploading stylesheet images with invalid filenames. Previously anAssertionErrorwas raised.Submission’sgildedattribute properly returns the expected value from reddit.
5.0.1 (2017/07/11)#
Fixed
5.0.0 (2017/07/04)#
Added
Comment.disable_inbox_replies(),Comment.enable_inbox_replies()Submission.disable_inbox_replies(), andSubmission.enable_inbox_replies()to toggle inbox replies on comments and submissions.
Changed
cloudsearchis no longer the default syntax forsearch().luceneis now the default syntax so that PRAW’s default is aligned with Reddit’s default.Reddit.info()will now take either a list of fullnames or a single URL string.Subreddit.submit()accepts a flair template ID and text.
Fixed
Fix accessing
LiveUpdate.contribraisesAttributeError.
Removed
Iterating directly over
SubredditRelationship(e.g.,subreddit.banned,subreddit.contributor,subreddit.moderator, etc) andSubredditFlairis no longer possible. Iterate instead over their callables, e.g.subreddit.banned()andsubreddit.flair().The following methods are removed:
Subreddit.mod.approve,Subreddit.mod.distinguish,Subreddit.mod.ignore_reports,Subreddit.mod.remove,Subreddit.mod.undistinguish,Subreddit.mod.unignore_reports.Support for passing a
SubmissiontoSubredditFlair.set()is removed.The
thingargument toSubredditFlair.set()is removed.Return values from
Comment.block(),Message.block(),SubredditMessage.block(),SubredditFlair.delete(),friend(),Redditor.message(),Subreddit.message(),select(), andunfriend()are removed as they do not provide any useful information.praw.inino longer reads inhttp_proxyandhttps_proxysettings.is_linkparameter ofSubredditRedditorFlairTemplates.add()andSubredditRedditorFlairTemplates.clear(). UseSubredditLinkFlairTemplatesinstead.
4.6.0 (2017/07/04)#
The release’s sole purpose is to announce the deprecation of the is_link parameter
as described below:
Added
SubredditFlair.link_templatesto manage link flair templates.
Deprecated
is_linkparameter ofSubredditRedditorFlairTemplates.add()andSubredditRedditorFlairTemplates.clear(). UseSubredditLinkFlairTemplatesinstead.
4.5.1 (2017/05/07)#
Fixed
Calling
parent()works onCommentinstances obtained viacomment_replies().
4.5.0 (2017/04/29)#
Added
Modmail.unread_count()to get unread count by conversation state.Modmail.bulk_read()to mark conversations as read by conversation state.Modmail.subreddits()to fetch subreddits using new modmail.Modmail.create()to create a new modmail conversation.ModmailConversation.read()to mark modmail conversations as read.ModmailConversation.unread()to mark modmail conversations as unread.conversations()to get new modmail conversations.ModmailConversation.highlight()to highlight modmail conversations.ModmailConversation.unhighlight()to unhighlight modmail conversations.ModmailConversation.mute()to mute modmail conversations.ModmailConversation.unmute()to unmute modmail conversations.ModmailConversation.archive()to archive modmail conversations.ModmailConversation.unarchive()to unarchive modmail conversations.ModmailConversation.reply()to reply to modmail conversations.Modmail.__call__()to get a new modmail conversation.Inbox.stream()to stream new items in the inbox.Exponential request delay to all streams when no new items are returned in a request. The maximum delay between requests is 66 seconds.
Changed
submit()acceptsselftext=''to create a title-only submission.Redditacceptsrequestor_class=clsfor a customized requestor class andrequestor_kwargs={"param": value}for passing arguments to requestor initialization.SubredditStream.comments(),SubredditStream.submissions(), andSubreddits.stream()accept apause_afterargument to allow pausing of the stream. The default value ofNoneretains the preexisting behavior.
Deprecated
cloudsearchwill no longer be the default syntax forSubreddit.search()in PRAW 5. Instead,lucenewill be the default syntax so that PRAW’s default is aligned with Reddit’s default.
Fixed
Fix bug where
WikiPagerevisions with deleted authors causedTypeError.Submissionattributescomment_limitandcomment_sortmaintain their values after making instances non-lazy.
4.4.0 (2017/02/21)#
Added
LiveThreadContribution.update()to update settings of a live thread.reset_timestamptolimits()to provide insight into when the current rate limit window will expire.upload_mobile_header()to upload subreddit mobile header.upload_mobile_icon()to upload subreddit mobile icon.delete_mobile_header()to remove subreddit mobile header.delete_mobile_icon()to remove subreddit mobile icon.LiveUpdateContribution.strike()to strike a content of a live thread.LiveContributorRelationship.update()to update contributor permissions for a redditor.LiveContributorRelationship.update_invite()to update contributor invite permissions for a redditor.LiveThread.discussions()to get submissions linking to the thread.LiveThread.report()to report the thread violating the Reddit rules.LiveHelper.now()to get the currently featured live thread.LiveHelper.info()to fetch information about each live thread in live thread IDs.
Fixed
Uploading an image resulting in too large of a request (>500 KB) now raises
prawcore.TooLargeinstead of anAssertionError.Uploading an invalid image raises
APIException.Redditorinstances obtained viamoderator(e.g.,reddit.subreddit("test").moderator()) will contain attributes with the relationship metadata (e.g.,mod_permissions).Messageinstances retrieved from the inbox now have attributesauthor,destrepliesandsubredditproperly converted to their appropriate PRAW model.
4.3.0 (2017/01/19)#
Added
LiveContributorRelationship.leave()to abdicate the live thread contributor position.LiveContributorRelationship.remove()to remove the redditor from the live thread contributors.limits()to provide insight into number of requests made and remaining in the current rate limit window.LiveThread.contribto obtain an instance ofLiveThreadContribution.LiveThreadContribution.add()to add an update to the live thread.LiveThreadContribution.close()to close the live thread permanently.LiveUpdate.contribto obtain an instance ofLiveUpdateContribution.LiveUpdateContribution.remove()to remove a live update.LiveContributorRelationship.accept_invite()to accept an invite to contribute the live thread.SubredditHelper.create()andSubredditModeration.update()have documented support forspoilers_enabled. Note, however, thatSubredditModeration.update()will currently unset thespoilers_enabledvalue until such a time that Reddit returns the value along with the other settings.spoiler()andunspoiler()to change a submission’s spoiler status.
Fixed
LiveContributorRelationship.invite()andLiveContributorRelationship.remove_invite()now hit endpoints, which starts with “api/”, for consistency.ModeratorRelationship.update(), andModeratorRelationship.update_invite()now always remove known unlisted permissions.
4.2.0 (2017/01/07)#
Added
.Subreddit.rulesto get the rules of a subreddit.LiveContributorRelationship, which can be obtained throughLiveThread.contributor, to interact with live threads’ contributors.remove_invite()to remove a moderator invite.LiveContributorRelationship.invite()to send a contributor invitation.LiveContributorRelationship.remove_invite()to remove the contributor invitation.
Deprecated
Return values from
Comment.block(),Message.block(),SubredditMessage.block(),SubredditFlair.delete(),friend(),Redditor.message(),Subreddit.message(),select(), andunfriend()will be removed in PRAW 5 as they do not provide any useful information.
Fixed
hide()andunhide()now accept a list of additional submissions.replace_more()is now recoverable. Previously, when an exception was raised during the work done byreplace_more(), all unreplacedMoreCommentsinstances were lost. NowMoreCommentsinstances are only removed once their children have been added to theCommentForestenabling callers ofreplace_more()to call the method as many times as required to complete the replacement.Working with contributors on
SubredditWikiis done consistently throughcontributornotcontributors.Subreddit.moderator()works.live_thread.contributor()now returnsRedditorListcorrectly.
Removed
validate_time_filteris no longer part of the public interface.
4.1.0 (2016/12/24)#
Added
Subreddits.search_by_topic()to search subreddits by topic. (see: https://www.reddit.com/dev/api/#GET_api_subreddits_by_topic).LiveHelper.__call__()to provide interface topraw.models.LiveThread.__init__.SubredditFiltersto work with filters for special subreddits, liker/all.Added callables for
SubredditRelationshipandSubredditFlairso thatlimitand other parameters can be passed.Add
Message.reply()toMessagewhich was accidentally missed previously.Add
stickyparameter toCommentModeration.distinguish()to sticky comments.Submission.flair()to add a submission’s flair from an instance ofSubmission.Comment.parent()to obtain the parent of aComment.opt_in()andopt_out()toSubredditto permit working with quarantined subreddits.LiveUpdateto represent an individual update in aLiveThread.Ability to access an individual
LiveUpdateviareddit.live("THREAD_ID")["UPDATE_ID"].LiveThread.updates()to iterate the updates of the thread.
Changed
me()now caches its result in order to reduce redundant requests for methods that depend on it. Setuse_cache=Falsewhen calling to bypass the cache.replace_more()can be called onCommentreplies.
Deprecated
validate_time_filterwill be removed from the public interface in PRAW 4.2 as it was never intended to be part of it to begin with.Iterating directly over
SubredditRelationship(e.g.,subreddit.banned,subreddit.contributor,subreddit.moderator, etc) andSubredditFlairwill be removed in PRAW 5. Iterate instead over their callables, e.g.subreddit.banned()andsubreddit.flair().The following methods are deprecated to be removed in PRAW 5 and are replaced with similar
Comment.mod...andSubmission.mod...alternatives:Subreddit.mod.approve,Subreddit.mod.distinguish,Subreddit.mod.ignore_reports,Subreddit.mod.remove,Subreddit.mod.undistinguish,Subreddit.mod.unignore_reports.Support for passing a
SubmissiontoSubredditFlair.set()will be removed in PRAW 5. UseSubmission.flair()instead.The
thingargument toSubredditFlair.set()is replaced withredditorand will be removed in PRAW 5.
Fixed
SubredditModeration.update()accurately updatesexclude_banned_modqueue,header_hover_text,show_mediaandshow_media_previewvalues.Instances of
Commentobtained through the inbox (including mentions) are now refreshable.Searching
r/allshould now work as intended for all users.Accessing an invalid attribute on an instance of
Messagewill raiseAttributeErrorinstead ofPRAWException.
4.0.0 (2016/11/29)#
Fixed
Fix bug where ipython tries to access attribute
_ipython_canary_method_should_not_exist_resulting in a useless fetch.Fix bug where
Commentreplies becomes[]after attempting to access an invalid attribute on the Comment.Reddit.wiki[…] converts the passed in page name to lower case as pages are only saved in lower case and non-lower case page names results in a Redirect exception (thanks pcjonathan).
4.0.0rc3 (2016/11/26)#
Added
implicitparameter tourl()to support the implicit flow for installed applications (see: https://github.com/reddit/reddit/wiki/OAuth2#authorization-implicit-grant-flow)scopes()to discover which scopes are available to the current authenticationLots of documentation: https://praw.readthedocs.io/
4.0.0rc2 (2016/11/20)#
Fixed
Auth.authorize()properly sets the session’s Authentication (thanks @williammck).
4.0.0rc1 (2016/11/20)#
PRAW 4 introduces significant breaking changes. The numerous changes are not listed here, only the feature removals. Please read through Quick Start to help with updating your code to PRAW 4. If you require additional help please ask on r/redditdev or via Slack.
Added
Comment.block(),Message.block(), andSubredditMessage.block()to permit blocking unwanted user contact.LiveHelper.create()to create new live threads.Redditor.unblock()to undo a block.Subreddits.gold()to iterate through gold subreddits.Subreddits.search()to search for subreddits by name and description.Subreddits.stream()to obtain newly created subreddits in near realtime.User.karma()to retrieve the current user’s subreddit karma.praw.models.reddit.submission.SubmissionModeration.lockandpraw.models.reddit.submission.SubmissionModeration.unlockto change a Submission’s lock state.SubredditFlairTemplates.delete()to delete a single flair template.SubredditModeration.unread()to iterate over unread moderation messages.ModeratorRelationship.invite()to invite a moderator to a subreddit.ModeratorRelationship.update()to update a moderator’s permissions.ModeratorRelationship.update_invite()to update an invited moderator’s permissions.Front.random_rising(),Subreddit.random_rising()andMultireddit.random_rising().WikiPagesupports a revision argument.SubredditWiki.revisions()to obtain a list of recent revisions to a subreddit.WikiPage.revisions()to obtain a list of revisions for a wiki page.Support installed-type OAuth apps.
Support read-only OAuth for all application types.
Support script-type OAuth apps.
Changed
Note
Only prominent changes are listed here.
helpers.comments_streamis nowSubredditStream.comments()helpers.submissions_betweenis nowSubreddit.submissions. This new method now only iterates through newest submissions first and as a result makes approximately 33% fewer requests.helpers.submission_streamis nowSubredditStream.submissions()
Removed
Removed
Reddit’sloginmethod. Authentication must be done through OAuth.Removed
praw-multiprocessas this functionality is no longer needed with PRAW 4.Removed non-oauth functions
Message.collapseandMessage.uncollapseis_username_available.Removed captcha related functions.
For changes prior to version 4.0 please see: 3.6.2 changelog