Praw

Latest version: v7.7.1

Safety actively analyzes 630169 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 3 of 7

7.1.0

------------------

**Added**

- :class:`.Rule` to represent one rule of a subreddit.
- :class:`.SubredditRules` to get and add rules.
- Ability to submit polls with :meth:`~.Subreddit.submit_poll`.
- :class:`.PollData` and :class:`.PollOption`.
- Ability to view poll data and poll options via the ``.poll_data`` attribute on poll
submissions.
- Add method :meth:`~.Reddit.delete` to :class:`.Reddit` class to support HTTP DELETE
requests.
- Added :class:`.CalendarConfiguration` to represent the configuration of a
:class:`.Calendar` widget.
- Added :class:`.Hover` to represent the hover state of a :class:`.Button`.
- Added :class:`.Styles` to represent widget styling information.
- Ability to stream live thread updates via new class :class:`.LiveThreadStream` with
method :meth:`~.LiveThreadStream.updates`.

**Changed**

- :meth:`.RemovalReason.update`'s parameters are now optional.
- :meth:`.SubredditRemovalReasons.__getitem__` now takes integers and slices to get
removal reasons from the list of reasons as returned by Reddit.

**Deprecated**

- :attr:`.WebSocketException.original_exception` is deprecated and slated for removal in
PRAW 8.0.

**Fixed**

- An issue where certain subreddit settings could not be set through
:meth:`.SubredditModeration.update`, such as ``welcome_message_enabled`` and
``welcome_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 original ``BadRequest``.
- :meth:`~.Subreddit.submit_image` and :meth:`~.Subreddit.submit_video` will throw
:class:`.MediaPostFailed` when Reddit fails to post an image or video post.

7.0.0

------------------

**Added**

- ``config_interpolation`` parameter for :class:`.Reddit` supporting basic and extended
modes.
- Add :meth:`.partial_redditors` that returns lightweight redditor objects that contain
only a few fields. This is useful for resolving :class:`.Redditor` IDs to their
usernames in bulk.
- :meth:`.User.friends` has a new parameter ``user`` that takes either an instance of
:class:`.Redditor` or a string containing a redditor name and returns an instance of
:class:`.Redditor` if the authenticated user is friends with the user, otherwise
throws an exception.
- :meth:`.SubmissionModeration.flair` has the parameter ``flair_template_id`` for
applying flairs with template IDs.
- :meth:`.Emoji.update` supports modifying an emoji's permissions.
- :meth:`.SubredditEmoji.add` now supports optionally passing booleans to set an emoji's
permissions upon upload.
- Methods :meth:`.SubredditLinkFlairTemplates.update` and
:meth:`.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 :meth:`.SubredditLinkFlairTemplates.update` and
:meth:`.SubredditRedditorFlairTemplates.update` that are left as the defaults will no
longer be over-written if the ``fetch`` parameter is set to ``True``, but will fill in
existing values for the flair template.
- The parameter ``text`` for methods :meth:`.SubredditLinkFlairTemplates.update` and
:meth:`.SubredditRedditorFlairTemplates.update` is no longer required.
- There is a new method, :meth:`~.Subreddit.post_requirements`, to fetch a subreddit's
post requirements.
- Method :meth:`.SubmissionModeration.sticky` will now ignore the Conflict exception
generated by trying to sticky the same post multiple times.
- A new method :meth:`.CommentModeration.show` will uncollapse a comment that was
collapsed because of Crowd Control
- Methods :meth:`~.Subreddit.submit_image` and :meth:`~.Subreddit.submit_video` will
throw :class:`.TooLargeMediaException` if the submitted media is rejected by Reddit
due to the size of the media.
- Class :class:`.Reddit` has an attribute, ``validate_on_submit``, that can be set after
class initialization that causes methods :meth:`~.Subreddit.submit`,
:meth:`~.Subreddit.submit_image`, :meth:`~.Subreddit.submit_video`, and
:meth:`.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, :class:`.RedditErrorItem`, to represent an individual error
item returned from Reddit.
- Class :class:`.RedditAPIException` now serves as a container for the
:class:`.RedditErrorItem`\ s. You can access the items by doing
``RedditAPIException.items``, which returns a list.
- :class:`.APIException` is an alias to :class:`.RedditAPIException`.
- Parameter ``discussion_type`` to methods :meth:`~.Subreddit.submit`,
:meth:`~.Subreddit.submit_image`, and :meth:`~.Subreddit.submit_video` to support
submitting as a live discussion (set to ``"CHAT"``).
- Instances of :class:`.Trophy` can be compared for equality with each other.
- :class:`.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
:class:`.RedditAPIException`.
- :class:`.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
:class:`.RedditAPIException` instance will be raised.
- Set the default comment sort to ``confidence`` instead of ``best`` because it turns
out ``best`` isn't actually the correct value for the parameter.

**Deprecated**

- :class:`.APIException` is deprecated and slated for removal in PRAW 8.0.

**Fixed**

- :meth:`.SubredditFlair.update` will not error out when the flair text contains quote
marks.

**Removed**

- Converting :class:`.APIException` to string will no longer escape unicode characters.
- Module ``praw.models.modaction`` no longer exists. Please use the module
``praw.models.mod_action``, or directly import ``ModAction`` from ``praw.models``.
- Methods :meth:`.SubredditLinkFlairTemplates.update` and
:meth:`.SubredditRedditorFlairTemplates.update` will no longer create flairs that are
using an invalid template id, but instead throw a :class:`.InvalidFlairTemplateID`.
- Method ``reddit.user.moderator_subreddits`` has been removed. Please use
:meth:`.moderated` instead.

6.5.1

------------------

**Fixed**

- Removed usages of ``NoReturn`` that caused PRAW to fail due to ``ImportError`` in
Python ``<3.5.4`` and ``<3.6.2``.

6.5.0

------------------

**Added**

- :meth:`.set_original_content` supports marking a submission as original content.
- :meth:`.unset_original_content` supports unmarking a submission as original content.
- :meth:`.moderated` to get a list of a redditor's moderated subreddits.
- Parameter ``without_websockets`` to :meth:`~.Subreddit.submit_image` and
:meth:`~.Subreddit.submit_video` to submit without using WebSockets.
- :meth:`.Reddit.redditor` supports ``fullname`` param to fetch a :class:`.Redditor` by
the fullname instead of name. :class:`.Redditor` constructor now also has ``fullname``
param.
- Add :class:`.RemovalReason` and :class:`.SubredditRemovalReasons` to work with removal
reasons
- Attribute ``removal_reasons`` to :class:`.SubredditModeration` to interact with new
removal reason classes
- Parameters ``mod_note`` and ``reason_id`` to :meth:`~.ThingModerationMixin.remove` to
optionally apply a removal reason on removal
- Add :class:`.SubredditModerationStream` to enable moderation streams
- Attribute ``stream`` to :class:`.SubredditModeration` to interact with new moderation
streams
- Add :meth:`~.SubredditModerationStream.edited` to allow streaming of
:meth:`.SubredditModeration.edited`
- Add :meth:`~.SubredditModerationStream.log` to allow streaming of
:meth:`.SubredditModeration.log`
- Add :meth:`~.SubredditModerationStream.modmail_conversations` to allow streaming of
:meth:`.Modmail.conversations`
- Add :meth:`~.SubredditModerationStream.modqueue` to allow streaming of
:meth:`.SubredditModeration.modqueue`
- Add :meth:`~.SubredditModerationStream.reports` to allow streaming of
:meth:`.SubredditModeration.reports`
- Add :meth:`~.SubredditModerationStream.spam` to allow streaming of
:meth:`.SubredditModeration.spam`
- Add :meth:`~.SubredditModerationStream.unmoderated` to allow streaming of
:meth:`.SubredditModeration.unmoderated`
- Add :meth:`~.SubredditModerationStream.unread` to allow streaming of
:meth:`.SubredditModeration.unread`
- Parameter ``exclude_before`` to :func:`.stream_generator` to allow
:meth:`~.SubredditModerationStream.modmail_conversations` to work
- Parameters ``allowable_content`` and ``max_emojis`` to
:meth:`~.SubredditRedditorFlairTemplates.add`,
:meth:`~.SubredditLinkFlairTemplates.add`, and
:meth:`~.SubredditFlairTemplates.update`, as well as its child classes.

**Deprecated**

- Method ``reddit.user.moderator_subreddits`` as :meth:`.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 ``APIException`` will no longer unicode-escape strings in the next
minor release.

6.4.0

------------------

**Added**

- :meth:`.crosspost` support parameter ``flair_id`` to flair the submission immediately
upon crossposting.
- :meth:`.crosspost` support parameter ``flair_text`` to set a custom text to the flair
immediately upon crossposting.
- :meth:`.crosspost` support parameter ``nsfw`` to mark the submission NSFW immediately
upon crossposting.
- :meth:`.crosspost` support parameter ``spoiler`` to mark the submission as a spoiler
immediately upon crossposting.

**Fixed**

- :meth:`.add_community_list` has parameter ``description`` to support unannounced
upstream Reddit API changes.
- :meth:`.WidgetModeration.update` supports passing a list of :class:`.Subreddit`
objects.

**Changed**

- Removed ``css_class`` parameter cannot be used with ``background_color``,
``text_color``, or ``mod_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.

6.3.1

------------------

**Removed**

- ``SubredditListingMixin.gilded()``, as this was supposed to be removed in 6.0.0 after
deprecation in 5.2.0.

Page 3 of 7

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.