jsonrpcclientΒΆ

Send JSON-RPC requests in Python.

$ pip install "jsonrpcclient[requests]"
from jsonrpcclient.clients.http_client import HTTPClient
client = HTTPClient("http://localhost:5000")
response = client.request("ping")
>>> response.text
'{"jsonrpc": "2.0", "result": "pong", "id": 1}'
>>> response.data.result
'pong'

This example uses the requests library for sending, but more options are available. See examples in various frameworks, or read the guide to usage and configuration.

Contribute on Github.

See also: jsonrpcserver