dr c6b132df62 feat: add vote_rant and vote_comment methods with VoteReason enum to api client
Implement two new async methods for voting on rants and comments, accepting vote values of -1, 0, or 1 with an optional VoteReason enum (NOT_FOR_ME, REPOST, OFFENSIVE_SPAM). Both methods require authentication, construct POST requests to the respective endpoints with vote and reason parameters, and return the success boolean from the response. Also add the VoteReason enum and update the todo list by removing the completed voting comment item.
2024-12-03 21:25:03 +00:00

devRanta

devRanta is an async devrant client written in and for Python. Authentication is only needed for half of the functionality and thus username and password are optional parameters by constructing the main class of this package (Api).

You can find last packages in tar and wheel format here.

Running

make run

Testing

Tests are only made for methods not requireing authentication. I do not see value in mocking requests.

make test

How to use

Implementation:

from devranta.api import Api 

api = Api(username="optional!", password="optional!")

async def list_rants():
    async for rant in api.get_rants():
        print(rant["user_username"], ":", rant["text"])

See tests for examples on how to use.

Todo

  • edit message
S
Description
Async Python client for devRant developer community.
Readme
145 KiB
Languages
Python 94.5%
Makefile 5.5%