explodinglabs / jsonrpcserver

Process incoming JSON-RPC requests in Python

Home Page:https://www.jsonrpcserver.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

jsonrpcserver

PyPI Code Quality Coverage Status Downloads

Process incoming JSON-RPC requests in Python.

pip install jsonrpcserver
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

About

Process incoming JSON-RPC requests in Python

https://www.jsonrpcserver.com

License:MIT License


Languages

Language:Python 100.0%