Skip to content

Latest commit

 

History

History
38 lines (28 loc) · 1.11 KB

README.md

File metadata and controls

38 lines (28 loc) · 1.11 KB

jsonrpcclient

PyPI Code Quality Coverage Status Downloads

Create JSON-RPC requests and parse responses in Python.

pip install jsonrpcclient

Generate a request:

from jsonrpcclient import request, parse
req = request("ping")
# => {'jsonrpc': '2.0', 'method': 'ping', 'id': 1}

Parse a response:

parsed = parse({"jsonrpc": "2.0", "result": "pong", "id": 1})
# => Ok(result='pong', id=1)

For strings, use request_json and parse_json.

Watch a video on how to use it

Full documentation is at jsonrpcclient.com.

See also: jsonrpcserver