Releases: Dan6erbond/aPRAW
v0.5.1-alpha
Change Log
class CommentForrest
has been refactored toclass CommentForest
.
v0.5.0-alpha
Update Log
aPRAWBase
- aPRAWBase can now be loaded as lazy objects.
- Added overridable method
fetch()
and implemented forclass 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()
orComment.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 theclass ExponentialCounter
used in streams to monitor a comment and repeatedly callfetch()
.
- Using
Comment Forrests:
- The
class CommentForrest
was added as well asclass MoreChildren
, based on theclass Listing
.- Comment forests can contain
class Comment
as well asclass MoreComments
. CommentForrest.replace_more()
will replace allclass MoreComments
within the tree asynchronously.class CommentForrest
is used inSubmission.comments
as well asComment.replies
class MoreChildren
is a listing for responses from the/morechildren
endpoint.
- Comment forests can contain
- 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 withclass MoreComments
.
- Using
Other
- Add
Reddit.close()
to properly close openClientSession
s.
Fixes
- Streams such as
Subreddit.new.stream()
were fixed as previously they would ignore all new posts. User.get_auth_session()
andget_client_session()
are now asynchronous methods to ensure a running event loop.- Fix use of
random.random()
inclass 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
Update Log
Listings:
- Create
class ListingGenerator
with__aiter__
and async__anext__
methods to perform requests in the container. - Update
class Listing
to supportclass 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()
andunread()
listing generators.
Item Creation:
- Implement
Subreddit.submit()
and addenum SubmissionKind
(Thanks @SpyrosRoum!) - Create
Replyable
mixin used byclass Comment
,class Submission
,class Message
.
Other:
aPRAWBase.fullname
auto-property returns ID if kind is unknown.- Optimize imports by importing
API_PATH
fromconst.py
. class Comment
only sets URL ifpermalink
present indata
.- 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!) andtest_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
Update Log
Major:
- Implement
AuthenticatedUser.karma() -> Karma
withsubreddit() -> 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
andclass ListingGenerator
. Reddit.info()
withids
automatically splits into batches of 100 items.
- Add
- Explicitly set
kind
inclass aPRAWBase
and addfullname
auto-property. - Implement
class SubmissionModeration
andclass 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
andclass Comment
.- This does not change the usage of methods such as
save()
,hide()
andauthor()
.
- This does not change the usage of methods such as
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
Update Log
- Add
skip_existing
to streams, only recommended for use with/new
endpoints. - Refactor
class SubredditWikiPage
toSubredditWikipage
.
Tests:
- Improved tests for listing generator.
v0.3.0-alpha
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 anAuthenticatedUser
- Also includes
AuthenticatedUser
implementsRedditor
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__()
.
- Add
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
Update Log:
- Create
apraw.reddit.RequestHandler
to handle ratelimit and addasyncio.sleep()
to requests. - Create
apraw.reddit.Auth
to manage login tokens and ratelimit. - Remove unused
SubredditStream
class in favor of usingListingGenerator
. - Remove
apraw.Reddit.get_listing()
in favor of usingListingGenerator
. - Add usage of
ListingGenerator
to the following classes/methods:apraw.subreddit.SubredditModeration
apraw.subreddit.SubredditModmail
apraw.Redditor.comments()
andsubmissions()
apraw.Reddit.subreddits()
- Make
ListingGenerator.get_listing_generator() -> aiter()
a class-method. - Add
apraw.Comment.subreddit()
- Inject
apraw.Subreddit
intoapraw.Comment
wherever possible. - Add injection of
apraw.Subreddit
intoListingGenerator
for use inComment
andSubmission
. - Implement
/api/info
endpoint:apraw.Reddit.info(id: str, ids: List[str], url: str)
Tests:
- Update tests using PyTest framework. Create
confest.py
with globalReddit
fixture. - Add (incomplete) type-hinting to tests.
- Write tests for
apraw.Subreddit.mod.reports()
andlog()
. - Write tests for
apraw.Comment.subreddit()
. - Write tests for
apraw.Reddit.subreddits
.
v0.1.1-alpha
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.