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. - Add method
~.Submission.award
and~.Comment.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
.
Changed
- Drop support for Python 3.5, which is end-of-life on 2020-09-13.
Deprecated
~.Subreddits.gold
is superseded by~.Subreddits.premium
.~.Submission.gild
is superseded by~.Submission.award
.~.Comment.gild
is superseded by~.Comment.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.
Added
.Rule
to represent one rule of a subreddit..SubredditRules
to get and add rules.- Ability to submit polls with
.submit_poll
. .PollData
and.PollOption
.- Ability to view poll data and poll options via the
.poll_data
attribute on poll submissions. - Add method
~.Reddit.delete
to.Reddit
class to support HTTP DELETE requests. - Added
.CalendarConfiguration
to represent the configuration of a.Calendar
widget. - Added
.Hover
to represent the hover state of a.Button
. - Added
.Styles
to represent widget styling information. - Ability to stream live thread updates via new class
.LiveThreadStream
with method~.LiveThreadStream.updates
.
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_exception
is deprecated and slated for removal in PRAW 8.0.
Deprecated
.SubredditStylesheet
's__call__
method (subreddit.stylesheet()
) is deprecated and slotted for removal in PRAW 8.0.
Fixed
- An issue where certain subreddit settings could not be set through
.SubredditModeration.update
, such aswelcome_message_enabled
andwelcome_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
BadRequest
s captured by PRAW that do not contain any detailed JSON data are re-raised as the originalBadRequest
. .submit_image
and.submit_video
will throw.MediaPostFailed
when Reddit fails to post an image or video post.
Removed
- Class
Stylesheet
no longer exists. It has been merged with.SubredditStylesheet
.
Added
config_interpolation
parameter for.Reddit
supporting basic and extended modes.- Add
.Redditors.partial_redditors
that returns lightweight redditor objects that contain only a few fields. This is useful for resolving Redditor IDs to their usernames in bulk. .User.friends
has a new parameteruser
that takes either an instance of.Redditor
or a string containing a redditor name and returns an instance of.Redditor
if the authenticated user is friends with the user, otherwise throws an exception..SubmissionModeration.flair
has the parameterflair_template_id
for 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
and.SubredditRedditorFlairTemplates.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
and.SubredditRedditorFlairTemplates.update
that are left as the defaults will no longer be over-written if thefetch
parameter is set toTrue
, but will fill in existing values for the flair template. - The parameter
text
for methods.SubredditLinkFlairTemplates.update
and.SubredditRedditorFlairTemplates.update
is no longer required. - There is a new method,
.Subreddit.post_requirements
, to fetch a subreddit's post requirements. - Method
.SubmissionModeration.sticky
will now ignore the Confict 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 Control - Methods
.Subreddit.submit_image
and.Subreddit.submit_video
will throw.TooLargeMediaException
if the submitted media is rejected by Reddit due to the size of the media. - Class
.Reddit
has an attribute,validate_on_submit
, that can be set after class initialization that causes methods.Subreddit.submit
,.Subreddit.submit_image
,.Subreddit.submit_video
, and.Submission.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
.RedditAPIException
now serves as a container for the.RedditErrorItem
s. You can access the items by doingRedditAPIException.items
, which returns a list. .APIException
is an alias to.RedditAPIException
.- Parameter
discussion_type
to methods.Subreddit.submit
,.Subreddit.submit_image
, and.Subreddit.submit_video
to support submitting as a live discussion (set toCHAT
). - Instances of
.Trophy
can be compared for equality with each other. .Reddit
has 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
. .Reddit
has 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.BadRequest
should no longer be raised. Instead a more useful.RedditAPIException
instance will be raised.- Set the default comment sort to
confidence
instead ofbest
because it turns outbest
isn't actually the correct value for the parameter.
Deprecated
.APIException
is 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
.APIException
to string will no longer escape unicode characters. - Module
praw.models.modaction
no longer exists. Please use the modulepraw.models.mod_action
, or directly importModAction
frompraw.models
. - Methods
.SubredditLinkFlairTemplates.update
and.SubredditRedditorFlairTemplates.update
will no longer create flairs that are using an invalid template id, but instead throw a.InvalidFlairTemplateID
. - Method
reddit.user.moderator_subreddits
has been removed. Please use.Redditor.moderated
instead.
Fixed
- Removed usages of
NoReturn
that caused PRAW to fail due toImportError
in Python<3.5.4
and<3.6.2
.
Added
.set_original_content
supports marking a submission as original content..unset_original_content
supports unmarking a submission as original content..Redditor.moderated
to get a list of a Redditor's moderated subreddits.- Parameter
without_websockets
to~.Subreddit.submit_image
and~.Subreddit.submit_video
to submit without using WebSockets. .Reddit.redditor
supportsfullname
param to fetch a Redditor by the fullname instead of name..Redditor
constructor now also hasfullname
param.- Add
.RemovalReason
and.SubredditRemovalReasons
to work with removal reasons - Attribute
removal_reasons
to.SubredditModeration
to interact with new removal reason classes - Parameters
mod_note
andreason_id
to.ThingModerationMixin.remove
to optionally apply a removal reason on removal - Add
.SubredditModerationStream
to enable moderation streams - Attribute
stream
to.SubredditModeration
to interact with new moderation streams - Add
.SubredditModerationStream.edited
to allow streaming of.SubredditModeration.edited
- Add
.SubredditModerationStream.log
to allow streaming of.SubredditModeration.log
- Add
.SubredditModerationStream.modmail_conversations
to allow streaming of.Modmail.conversations
- Add
.SubredditModerationStream.modqueue
to allow streaming of.SubredditModeration.modqueue
- Add
.SubredditModerationStream.reports
to allow streaming of.SubredditModeration.reports
- Add
.SubredditModerationStream.spam
to allow streaming of.SubredditModeration.spam
- Add
.SubredditModerationStream.unmoderated
to allow streaming of.SubredditModeration.unmoderated
- Add
.SubredditModerationStream.unread
to allow streaming of.SubredditModeration.unread
- Parameter
exclude_before
to.stream_generator
to allow.SubredditModerationStream.modmail_conversations
to work - Parameters
allowable_content
andmax_emojis
to~.SubredditRedditorFlairTemplates.add
,~.SubredditLinkFlairTemplates.add
, and~.SubredditFlairTemplates.update
, as well as its child classes.
Deprecated
- Method
reddit.user.moderator_subreddits
as.Redditor.moderated
provides more functionality. - The file for ModActions (praw/models/modaction.py) has been moved to praw/models/mod_action.py and the previous has been Deprecated.
Expected Changes
- The behavior of func:APIException will no longer unicode-escape strings in the next minor release
Added
~.Submission.crosspost
support parameterflair_id
to flair the submission immediately upon crossposting.~.Submission.crosspost
support parameterflair_text
to set a custom text to the flair immediately upon crossposting.~.Submission.crosspost
support parameternsfw
to mark the submission NSFW immediately upon crossposting.~.Submission.crosspost
support parameterspoiler
to mark the submission as a spoiler immediately upon crossposting.
Fixed
.add_community_list
has parameterdescription
to support unannounced upstream Reddit API changes.~.WidgetModeration.update
supports passing a list of.Subreddit
objects.
Changed
Removed
css_class
parameter cannot be used withbackground_color
,text_color
, ormod_only
constraint 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.
Removed
SubredditListingMixin.gilded()
, as this was supposed to be removed in 6.0.0 after deprecation in 5.2.0.
Added
- Collections (
.Collection
and helper classes). .submit
,.submit_image
, and.submit_video
can be used to submit a post directly to a collection.praw.util.camel_to_snake
andpraw.util.snake_case_keys
.- Comments can now be locked and unlocked via
comment.mod.lock()
andcomment.mod.unlock()
. See: (.ThingModerationMixin.lock
and.ThingModerationMixin.unlock
). align
parameter to.SubredditStylesheet.upload_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 theurl
parameter.
Added
.SubredditStylesheet.upload_banner
.SubredditStylesheet.upload_banner_additional_image
.SubredditStylesheet.upload_banner_hover_image
.SubredditStylesheet.delete_banner
.SubredditStylesheet.delete_banner_additional_image
.SubredditStylesheet.delete_banner_hover_image
~.Subreddit.submit
,~.Subreddit.submit_image
, and~.Subreddit.submit_video
support parameternsfw
to mark the submission NSFW immediately upon posting.~.Subreddit.submit
,~.Subreddit.submit_image
, and~.Subreddit.submit_video
support parameterspoiler
to mark the submission as a spoiler immediately upon posting.~.Subreddit.submit_image
and~.Subreddit.submit_video
support parametertimeout
. Default timeout has been raised from 2 seconds to 10 seconds.- Added parameter
function_kwargs
to.stream_generator
to pass additional kwargs tofunction
.
Fixed
.Subreddit.random
returnsNone
instead of raising.ClientException
when the subreddit does not support generating random submissions.
Other
- Bumped minimum prawcore version to 1.0.1.
Added
~.SubredditFlair.set
supports parameterflair_template_id
for giving a user redesign flair.
Added
- Add method
.Redditor.trophies
to get a list of the Redditor's trophies. - Add class
.PostFlairWidget
. - Add attributes
reply_limit
andreply_sort
to class.Comment
- Add class
.SubredditWidgetsModeration
(accessible through.SubredditWidgets.mod
) and method.add_text_area
. - Add class
.WidgetModeration
(accessible through the.mod
attribute on any widget) with methods~.WidgetModeration.update
and~.WidgetModeration.delete
. - Add method
.Reddit.put
for HTTP PUT requests. - Add methods
.add_calendar
and.add_community_list
. - Add methods
.add_image_widget
and.upload_image
. - Add method
.add_custom_widget
. - Add method
.add_post_flair_widget
. - Add method
.add_menu
. - Add method
.add_button_widget
. - Add method
~.SubredditWidgetsModeration.reorder
to reorder a subreddit's widgets. - Add
.Redditors
(reddit.redditors
) to provide Redditor listings. - Add
.submit_image
for submitting native images to Reddit. - Add
.submit_video
for submitting native videos and videogifs to Reddit.
Changed
.User.me
returnsNone
in~praw.Reddit.read_only
mode..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
, and~.SubredditLinkFlairTemplates.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
Widget
s rather than raising an exception
Added
- Add method
.WikiPage.revision
to get a specific wiki page revision. - Added parameter
skip_existing
to.stream_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 like.TextArea
to support fetching Reddit widgets. - Add method
.Submission.mark_visited
to mark a submission as visited on the Reddit backend.
Fixed
- Fix
RecursionError
on.SubredditEmoji
'srepr
andstr
. .SubredditFilters.add
and.SubredditFilters.remove
also accept a.Subreddit
for thesubreddit
parameter.- Remove restriction which prevents installed (non-confidential) apps from using OAuth2 authorization code grant flow.
Removed
Subreddit.submissions
as the API endpoint backing the method is no more. See https://www.reddit.com/r/changelog/comments/7tus5f/update_to_search_api/.
Added
- Add method
~.Reddit.patch
to.Reddit
class to support HTTP PATCH requests. - Add class
.Preferences
to access and update Reddit preferences. - Add attribute
.User.preferences
to access an instance of.Preferences
. - Add method
.Message.delete()
. - Add class
.Emoji
to work with custom subreddit emoji.
Deprecated
Subreddit.submissions
as 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_after
values in streams provided by.stream_generator
where the wait time was not reset after a yieldedNone
. - Parse URLs with trailing slashes and no
"comments"
element when creating.Submission
objects. - Fix bug where
Subreddit.submissions
returns a same submission more than once - Fix bug where
ListingGenerator
fetches 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.
Added
.Multireddit.stream
, to stream submissions and comments from a Multireddit..Redditor.block
Fixed
- Now raises
prawcore.UnavailableForLegalReasons
instead of anAssertionError
when encountering a HTTP 451 response.
Changed
- An attribute on
.LiveUpdate
now works as lazy attribute (i.e. populate an attribute when the attribute is first accessed).
Deprecated
subreddit.comments.gilded
because there isn't actually an endpoint that returns only gilded comments. Usesubreddit.gilded
instead.
Fixed
- Removed
comment.permalink()
becausecomment.permalink
is now an attribute returned by Reddit.
Added
.Redditor.stream
, with methods.RedditorStream.submissions()
and.RedditorStream.comments()
to stream a Redditor's comments or submissions.RedditorStream
has been added to facilitate.Redditor.stream
.Inbox.collapse
to mark messages as collapsed..Inbox.uncollapse
to mark messages as uncollapsed.- Raise
.ClientException
when calling~.Comment.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 nested.Comment
will additionally pull in as many parent comments as possible (currently 8) enabling significantly quicker traversal to the top-most.Comment
via successive.parent()
calls. - Calling
~.Comment.refresh
previously could have resulted in aAttributeError: "MoreComments" object has no attribute "_replies"
exception. This situation will now result in a.ClientException
. - Properly handle
BAD_CSS_NAME
errors when uploading stylesheet images with invalid filenames. Previously anAssertionError
was raised. .Submission
'sgilded
attribute properly returns the expected value from reddit.
Fixed
- Calls to
.hide()
and.unhide()
properly batch into requests of 50 submissions at a time. - Lowered the average maximum delay between inactive stream checks by 4x to 16 seconds. It was previously 64 seconds, which was too long.
Added
.Comment.disable_inbox_replies
,.Comment.enable_inbox_replies
.Submission.disable_inbox_replies
, and.Submission.enable_inbox_replies
to toggle inbox replies on comments and submissions.
Changed
cloudsearch
is no longer the default syntax for.Subreddit.search
.lucene
is 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.contrib
raisesAttributeError
.
Removed
- Iterating directly over
.SubredditRelationship
(e.g.,subreddit.banned
,subreddit.contributor
,subreddit.moderator
, etc) and.SubredditFlair
is 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
.Submission
to.SubredditFlair.set
is removed. - The
thing
argument to.SubredditFlair.set
is removed. - Return values from
.Comment.block
,.Message.block
,.SubredditMessage.block
,.SubredditFlair.delete
,.friend
,.Redditor.message
,.Subreddit.message
,.select
, and.unfriend
are removed as they do not provide any useful information. praw.ini
no longer reads inhttp_proxy
andhttps_proxy
settings.is_link
parameter of.SubredditRedditorFlairTemplates.add
and.SubredditRedditorFlairTemplates.clear
. Use.SubredditLinkFlairTemplates
instead.
The release's sole purpose is to announce the deprecation of the is_link
parameter as described below:
Added
.SubredditFlair.link_templates
to manage link flair templates.
Deprecated
is_link
parameter of.SubredditRedditorFlairTemplates.add
and.SubredditRedditorFlairTemplates.clear
. Use.SubredditLinkFlairTemplates
instead.
Fixed
- Calling
.parent
works on.Comment
instances obtained via.comment_replies
.
Added
~praw.models.reddit.subreddit.Modmail.unread_count
to get unread count by conversation state.~praw.models.reddit.subreddit.Modmail.bulk_read
to mark conversations as read by conversation state.~praw.models.reddit.subreddit.Modmail.subreddits
to fetch subreddits using new modmail.~praw.models.reddit.subreddit.Modmail.create
to create a new modmail conversation.~praw.models.ModmailConversation.read
to mark modmail conversations as read.~praw.models.ModmailConversation.unread
to mark modmail conversations as unread.~praw.models.reddit.subreddit.Modmail.conversations
to get new modmail conversations.~praw.models.ModmailConversation.highlight
to highlight modmail conversations.~praw.models.ModmailConversation.unhighlight
to unhighlight modmail conversations.~praw.models.ModmailConversation.mute
to mute modmail conversations.~praw.models.ModmailConversation.unmute
to unmute modmail conversations.~praw.models.ModmailConversation.archive
to archive modmail conversations.~praw.models.ModmailConversation.unarchive
to unarchive modmail conversations.~praw.models.ModmailConversation.reply
to reply to modmail conversations.~praw.models.reddit.subreddit.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..Reddit
acceptsrequestor_class=cls
for a customized requestor class andrequestor_kwargs={"param": value}
for passing arguments to requestor initialization.~praw.models.reddit.subreddit.SubredditStream.comments
,~praw.models.reddit.subreddit.SubredditStream.submissions
, and~praw.models.Subreddits.stream
accept apause_after
argument to allow pausing of the stream. The default value ofNone
retains the preexisting behavior.
Deprecated
cloudsearch
will no longer be the default syntax for.Subreddit.search
in PRAW 5. Insteadlucene
will be the default syntax so that PRAW's default is aligned with Reddit's default.
Fixed
- Fix bug where
.WikiPage
revisions with deleted authors causedTypeError
. .Submission
attributescomment_limit
andcomment_sort
maintain their values after making instances non-lazy.
Added
.LiveThreadContribution.update
to update settings of a live thread.reset_timestamp
to.limits
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.TooLarge
instead of anAssertionError
. - Uploading an invalid image raises func:APIException.
.Redditor
instances obtained via.moderator
(e.g.,reddit.subreddit("subreddit").moderator()
) will contain attributes with the relationship metadata (e.g.,mod_permissions
)..Message
instances retrieved from the inbox now have attributesauthor
,dest
replies
andsubreddit
properly converted to their appropriate PRAW model.
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.contrib
to obtain an instance of.LiveThreadContribution
..LiveThreadContribution.add
to add an update to the live thread..LiveThreadContribution.close
to close the live thread permanently..LiveUpdate.contrib
to obtain an instance of.LiveUpdateContribution
..LiveUpdateContribution.remove
to remove a live update..LiveContributorRelationship.accept_invite
to accept an invite to contribute the live thread..SubredditHelper.create
and.SubredditModeration.update
have documented support forspoilers_enabled
. Note, however, that.SubredditModeration.update
will currently unset thespoilers_enabled
value until such a time that Reddit returns the value along with the other settings..spoiler
and.unspoiler
to change a submission's spoiler status.
Fixed
.LiveContributorRelationship.invite
and.LiveContributorRelationship.remove_invite
now hit endpoints, which starts with "api/", for consistency..ModeratorRelationship.update
, and.ModeratorRelationship.update_invite
now always remove known unlisted permissions.
Added
.Subreddit.rules
to get the rules of a subreddit..LiveContributorRelationship
, which can be obtained through.LiveThread.contributor
, to interact with live threads' contributors.~.ModeratorRelationship.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
, and.unfriend
will be removed in PRAW 5 as they do not provide any useful information.
Fixed
.hide()
and.unhide()
now accept a list of additional submissions..replace_more
is now recoverable. Previously, when an exception was raised during the work done by.replace_more
, all unreplaced.MoreComments
instances were lost. Now.MoreComments
instances are only removed once their children have been added to the.CommentForest
enabling callers of.replace_more
to call the method as many times as required to complete the replacement.- Working with contributors on
.SubredditWiki
is done consistently throughcontributor
notcontributors
. Subreddit.moderator()
works.live_thread.contributor()
now returns.RedditorList
correctly.
Removed
validate_time_filter
is no longer part of the public interface.
Added
praw.models.Subreddits.search_by_topic
to search subreddits by topic. (see: https://www.reddit.com/dev/api/#GET_api_subreddits_by_topic).praw.models.LiveHelper.__call__
to provide interface topraw.models.LiveThread.__init__
..SubredditFilters
to work with filters for special subreddits, liker/all
.- Added callables for
.SubredditRelationship
and.SubredditFlair
so thatlimit
and other parameters can be passed. - Add
~praw.models.Message.reply
to.Message
which was accidentally missed previously. - Add
sticky
parameter to.CommentModeration.distinguish
to sticky comments. .flair
to add a submission's flair from an instance of.Submission
..Comment.parent
to obtain the parent of a.Comment
..opt_in
and.opt_out
to.Subreddit
to permit working with quarantined subreddits..LiveUpdate
to represent an individual update in a.LiveThread
.- Ability to access an individual
.LiveUpdate
viareddit.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=False
when calling to bypass the cache..replace_more
can be called on.Comment
replies
.
Deprecated
validate_time_filter
will 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) and.SubredditFlair
will 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
.Submission
to.SubredditFlair.set
will be removed in PRAW 5. Use.flair
instead. - The
thing
argument to.SubredditFlair.set
is replaced withredditor
and will be removed in PRAW 5.
Fixed
.SubredditModeration.update
accurately updatesexclude_banned_modqueue
,header_hover_text
,show_media
andshow_media_preview
values.- Instances of
.Comment
obtained through the inbox (including mentions) are now refreshable. - Searching
/r/all
should now work as intended for all users. - Accessing an invalid attribute on an instance of
.Message
will raise :py.AttributeError
instead of.PRAWException
.
Fixed
- Fix bug where ipython tries to access attribute
_ipython_canary_method_should_not_exist_
resulting in a useless fetch. - Fix bug where Comment replies 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).
Added
implicit
parameter to.url
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 authentication- Lots of documentation: https://praw.readthedocs.io/
Fixed
~praw.models.Auth.authorize
properly sets the session's Authentication (thanks @williammck).
PRAW 4 introduces significant breaking changes. The numerous changes are not listed here, only the feature removals. Please read through /getting_started/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
praw.models.Comment.block
,praw.models.Message.block
, andpraw.models.SubredditMessage.block
to permit blocking unwanted user contact.praw.models.LiveHelper.create
to create new live threads.praw.models.Redditor.unblock
to undo a block.praw.models.Subreddits.gold
to iterate through gold subreddits.praw.models.Subreddits.search
to search for subreddits by name and description.praw.models.Subreddits.stream
to obtain newly created subreddits in near-realtime.praw.models.User.karma
to retrieve the current user's subreddit karma.praw.models.reddit.submission.SubmissionModeration.lock
andpraw.models.reddit.submission.SubmissionModeration.unlock
to change a Submission's lock state.praw.models.reddit.subreddit.SubredditFlairTemplates.delete
to delete a single flair template.praw.models.reddit.subreddit.SubredditModeration.unread
to iterate over unread moderation messages.praw.models.reddit.subreddit.ModeratorRelationship.invite
to invite a moderator to a subreddit.praw.models.reddit.subreddit.ModeratorRelationship.update
to update a moderator's permissions.praw.models.reddit.subreddit.ModeratorRelationship.update_invite
to update an invited moderator's permissions.praw.models.Front.random_rising
,praw.models.Subreddit.random_rising
andpraw.models.Multireddit.random_rising
.~.WikiPage
supports 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_stream
is nowpraw.models.reddit.subreddit.SubredditStream.comments
helpers.submissions_between
is nowSubreddit.submissions
. This new method now only iterates through newest submissions first and as a result makes approximately 33% fewer requests.helpers.submission_stream
is nowpraw.models.reddit.subreddit.SubredditStream.submissions
Removed
- Removed
.Reddit
'slogin
method. Authentication must be done through OAuth. - Removed
praw-multiprocess
as this functionality is no longer needed with PRAW 4. - Removed non-oauth functions
Message.collapse
andMessage.uncollapse
is_username_available
. - Removed captcha related functions.
For changes prior to version 4.0 please see: 3.4.0 changelog