jrpc
Simplest ever possible Asynchronous JSON RPC via HTTP library for Python, backed by httpx.
Installation
pip install async-jrpc
Usage
- Import JRPC
from jrpc import JRPCClient
- Rock
async with JRPCClient(url="http://localhost:1337") as client:
print(await client.call("add", 2, 4))
print(await client.call("add", a=2, b=4)) # kwargs and args supported!
- Without pre-defined URL
async with JRPCClient() as client:
print(await client.raw_call("http://localhost:1337", "add", 2, 4))