Skip to content

Releases: Dan6erbond/aPRAW

v0.5.1-alpha

09 Jul 15:56
838f594
Compare
Choose a tag to compare
v0.5.1-alpha Pre-release
Pre-release

Change Log

  • class CommentForrest has been refactored to class CommentForest.

v0.5.0-alpha

09 Jul 15:49
Compare
Choose a tag to compare
v0.5.0-alpha Pre-release
Pre-release

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 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 ClientSessions.

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 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.

v0.4.5-alpha

05 Jul 14:36
Compare
Choose a tag to compare
v0.4.5-alpha Pre-release
Pre-release

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.

v0.4.0-alpha

29 Jun 18:12
729ee6c
Compare
Choose a tag to compare
v0.4.0-alpha Pre-release
Pre-release

Update Log

Major:

  • Implement AuthenticatedUser.karma() -> Karma with subreddit() -> Subreddit method.
  • Implement class Listing. Handles parsing of listings and acts as an iterator/generator.
    • Add last auto-property for last item.
    • Use in class Reddit and class ListingGenerator.
    • Reddit.info() with ids automatically splits into batches of 100 items.
  • Explicitly set kind in class aPRAWBase and add fullname auto-property.
  • Implement class SubmissionModeration and class CommentModeration.

Minor:

  • Improve typing and using functools.wraps() for wrapper functions.
  • Optimize imports.
  • Create and use mixins for hideable, spoilerable, savable etc. in class Submission and class Comment.
    • This does not change the usage of methods such as save(), hide() and author().

Docs:

  • Setup Sphinx documentation structure.
  • Document all classes, helpers and models used by end-user with NumPyDoc format.
  • Add installation, quickstart guide and examples.
  • Setup RTD Theme.
  • Publish docs to RTD.

Tests:

  • Write tests for class AuthenticatedUser.
  • Write tests for class SubmissionModeration, class CommentModeration and new mixins.

v0.3.2-alpha

23 Jun 08:03
Compare
Choose a tag to compare
v0.3.2-alpha Pre-release
Pre-release

Update Log

  • Add skip_existing to streams, only recommended for use with /new endpoints.
  • Refactor class SubredditWikiPage to SubredditWikipage.

Tests:

  • Improved tests for listing generator.

v0.3.0-alpha

23 Jun 06:50
Compare
Choose a tag to compare
v0.3.0-alpha Pre-release
Pre-release

Update Log

Typing:

aPRAW is now fully type-hinted. Type-hints were added to previously untyped methods.

class aPRAWBase:

Used in Subreddit, Submission and other Reddit items. Dynamically sets attributes from data, and parses created_utc if present. Method _update() takes data and updates class attributes if missing.

class User/class AuthenticatedUser:

  • Add class User managing user login information, access data, tokens and ratelimit.
    • Also includes me() returning an AuthenticatedUser
  • AuthenticatedUser implements Redditor features.
    • karma() method currently not mapped to correct endpoint.

Subreddit Wiki:

  • Implement class SubredditWiki, class SubredditWikiPage, class WikipageRevision;
    • Add SubredditWiki.revisions: ListingGenerator.
    • Add SubredditWiki.__call__() -> List[str].
    • Add SubredditWiki.page(page: str) -> SubredditWikiPage.
    • Add SubredditWiki.create(page: str, content_md: str, reason: str) -> SubredditWikiPage.
    • Add SubredditWikiPage.revisions: ListingGenerator.
    • Add SubredditWikiPage.add_editor(username: str).
    • Add SubredditWikiPage.del_editor(username: str).
    • Add SubredditWikiPage.edit(content_md: str, reason: str) -> bool.
    • Add WikipageRevision.__str__().

Other:

  • Add Reddit.wiki_revision_kind.
  • Add util function prepend_kind(org: str, kind: str).

Tests:

  • Tests are excluded from PyPi package.
  • Write tests for new wikiclasses and functions.
  • Write tests for new util function.

v0.2.0-alpha

15 Jun 11:25
Compare
Choose a tag to compare
v0.2.0-alpha Pre-release
Pre-release

Update Log:

  • Create apraw.reddit.RequestHandler to handle ratelimit and add asyncio.sleep() to requests.
  • Create apraw.reddit.Auth to manage login tokens and ratelimit.
  • Remove unused SubredditStream class in favor of using ListingGenerator.
  • Remove apraw.Reddit.get_listing() in favor of using ListingGenerator.
  • Add usage of ListingGenerator to the following classes/methods:
    • apraw.subreddit.SubredditModeration
    • apraw.subreddit.SubredditModmail
    • apraw.Redditor.comments() and submissions()
    • apraw.Reddit.subreddits()
  • Make ListingGenerator.get_listing_generator() -> aiter() a class-method.
  • Add apraw.Comment.subreddit()
  • Inject apraw.Subreddit into apraw.Comment wherever possible.
  • Add injection of apraw.Subreddit into ListingGenerator for use in Comment and Submission.
  • Implement /api/info endpoint: apraw.Reddit.info(id: str, ids: List[str], url: str)

Tests:

  • Update tests using PyTest framework. Create confest.py with global Reddit fixture.
  • Add (incomplete) type-hinting to tests.
  • Write tests for apraw.Subreddit.mod.reports() and log().
  • Write tests for apraw.Comment.subreddit().
  • Write tests for apraw.Reddit.subreddits.

v0.1.1-alpha

14 Jun 09:15
Compare
Choose a tag to compare
v0.1.1-alpha Pre-release
Pre-release

Initial release:

This first version features a PyPi release that can be installed on local clients and be used in a global context. Working and tested features include streams, endless listings, fetching Redditors, Subreddits, Modmail, Comments, Submissions as well as using Reddit's messaging service.