jsonrpcserver

Process JSON-RPC requests


Keywords
api, json-rpc, python
License
MIT
Install
pip install jsonrpcserver==5.0.9

Documentation

jsonrpcserver

PyPI Code Quality Coverage Status Downloads

Process incoming JSON-RPC requests in Python.

from jsonrpcserver import method, serve, Success

@method
def ping():
    return Success("pong")

if __name__ == "__main__":
    serve()

Or use dispatch instead of serve:

response = dispatch('{"jsonrpc": "2.0", "method": "ping", "id": 1}')
# => '{"jsonrpc": "2.0", "result": "pong", "id": 1}'

Watch a video on how to use it.

Full documentation is at jsonrpcserver.com.

See also: jsonrpcclient