Apraw

Latest version: v0.6.8a0

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

Scan your dependencies

Page 2 of 3

0.5.5alpha

Change Log

- Add support for /r/all listing endpoints and /r/mod moderation endpoints. (96)
- Can be instantiated as usual with `await reddit.subreddit("all")` or `await reddit.subreddit("mod")` and used.
- Attributes such as `id` and `fullname` won't be available as the data isn't available on Reddit.
- Use ReactivePy 2.0.0 with `_async_bulk_update` in `class Comment` to allow for asynchronous callbacks on attribute change. (97)

**`class SubredditRemovalReasons` / `class SubredditRemovalReason`:**

- Implement subreddit removal reasons with functionality to get reasons, add, delete and update.
- `class SubredditRemovalReasons` can be used as an async generator to loop over items.

View 98 for further details.

**Breaking changes:**

- `spoiler()` and `unspoiler()` have been renamed to `mark_spoiler()` and `unmark_spoiler()` respectively to avoid clashes with the `spoiler` attribute of `class Submission`. (93)

**Other:**

- Refactor `get_request()` and `post_request()` to `get()` and `post()` respectively.
- Add `put()` and `delete()` HTTP request methods to `class Reddit`.

0.5.3alpha

Change Log

**Hotfix:** `apraw.models.Message.author()` has been fixed and `apraw.Reddit.message()` returns a success boolean.

0.5.2alpha

Change Log

**Hotfix:** Streamable endpoints are now not applied to the last instance only, which enables concurrent streams.

0.5.1alpha

Change Log

- `class CommentForrest` has been refactored to `class CommentForest`.

0.5.0alpha

Update Log

aPRAWBase

- aPRAWBase can now be loaded as lazy objects.
- Added overridable method `fetch()` and implemented for `class Comment`, `class Redditor`, `class Submission`.
- Private members were refactored with an `_` (i.e. `_reddit` or `_data`).
- The `__repr__()` method was implemented returning a string in the format of `<{class} {id_attribute}='{id}'>`.
- Keeping track of attributes returned by the API with `_data_attrs`.

Comments

- `class Comment` is now reactive based on the [ReactivePy](https://github.com/Dan6erbond/ReactivePy) library.
- Using `Comment.on_change()` or `Comment.attribute.on_change()`, change handlers can be assigned to the object and are called whenever a comment is refreshed and attributes change.
- `Comment.monitor()` starts a loop based on the `class ExponentialCounter` used in streams to monitor a comment and repeatedly call `fetch()`.

**Comment Forrests:**

- The `class CommentForrest` was added as well as `class MoreChildren`, based on the `class Listing`.
- Comment forests can contain `class Comment` as well as `class MoreComments`.
- `CommentForrest.replace_more()` will replace all `class MoreComments` within the tree asynchronously.
- `class CommentForrest` is used in `Submission.comments` as well as `Comment.replies`
- `class MoreChildren` is a listing for responses from the `/morechildren` endpoint.
- The `class MoreComments` acts as an async generator and will grab further comments in batches of 100 until the list has been exhausted.
- Using `MoreComments.comments()` will fetch all the comments and return a flattened list.
- `MoreComments.parent()` will return the parent submission or comment.
- `depth` member attribute can be modified to adjust the depth of the comment tree when fetching more comments with `class MoreComments`.

Other

- Add `Reddit.close()` to properly close open `ClientSession`s.

Fixes

- Streams such as `Subreddit.new.stream()` were fixed as previously they would ignore all new posts.
- `User.get_auth_session()` and `get_client_session()` are now asynchronous methods to ensure a running event loop.
- Fix use of `random.random()` in `class ExponentialCounter`.

Tests

- `test_comment_forrest_replace_more` was added using a large [/r/facepalm](https://reddit.com/r/facepalm) thread.
- Test comments were replaced by those made by the bot account to avoid failures based on online data.
- Tests for old implementations of more children were removed.

**Note:** aPRAW v0.5.0-alpha has ReactivePy >= 1.9.0.dev0 as a requirement.

0.4.5alpha

Update Log

**Listings:**

- Create `class ListingGenerator` with `__aiter__` and async `__anext__` methods to perform requests in the container.
- Update `class Listing` to support `class Message`.
- Implement `Streamable.streamable` decorator that makes (a)sync functions returning iterables or generators streamable.

**Inbox:**

- Implement `class Message` for inbox messages.
- Implement `AuthenticatedUser.inbox()`, `sent()` and `unread()` listing generators.

**Item Creation:**

- Implement `Subreddit.submit()` and add `enum SubmissionKind` (Thanks SpyrosRoum!)
- Create `Replyable` mixin used by `class Comment`, `class Submission`, `class Message`.

**Other:**

- `aPRAWBase.fullname` auto-property returns ID if kind is unknown.
- Optimize imports by importing `API_PATH` from `const.py`.
- `class Comment` only sets URL if `permalink` present in `data`.
- Use raw docstrings in cases where "\*\*" escape sequence is used.
- Make `Submission.morechildren()` async generator.
- Read `praw.ini` file intelligently (Thanks H4CKY54CK!)

**Tests:**

- Update listing tests.
- Add `test_submission_reply`.
- Add `test_subreddit_submit` (Thanks SpyrosRoum!) and `test_subreddit_random`.
- Add `test_user_inbox`, `test_user_unread`, `test_user_sent`.
- Add `test_streamable` unit tests.

**Documentation:**

- Add `SubredditWiki` documentation page.
- Add `Streamable` documentation page.

Page 2 of 3

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.