Process incoming JSON-RPC requests in Python.
from jsonrpcserver import dispatch, method, Success
@method
def ping():
return Success("pong")
if __name__ == "__main__":
serve()Alternatively, use dispatch:
response = dispatch('{"jsonrpc": "2.0", "method": "ping", "id": 1}')
# => '{"jsonrpc": "2.0", "result": "pong", "id": 1}'Full documentation is at jsonrpcserver.com.
See also: jsonrpcclient
