retoor 4f8fc9f242 feat: add synchronous api_requests module with auth and voting for devRant
Introduce a dedicated synchronous API client module in src/devranta/api_requests.py that encapsulates request formatting, authentication via username/password login, and voting functionality for devRant interactions. The module provides an Api class with methods for login, URL patching, auth dict injection, and vote submission using the requests library, centralizing input preprocessing and reducing duplication across callers.
2025-04-23 13:59:14 +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.

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