• Stars
    star
    116
  • Rank 303,894 (Top 6 %)
  • Language
    Python
  • License
    MIT License
  • Created about 9 years ago
  • Updated 11 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Generate JSON-RPC requests and parse responses in Python

jsonrpcclient

PyPI Code Quality Coverage Status Downloads

Generate 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