Beau Barker

jsonrpcserverΒΆ

Process JSON-RPC requests in Python 2.7 and 3.3+.

from jsonrpcserver import methods

@methods.add
def ping():
    return 'pong'

if __name__ == '__main__':
    methods.serve_forever()

Start the server:

$ pip install jsonrpcserver
$ python server.py
 * Listening on port 5000

This example uses the built-in server, but you can process requests in any application with dispatch(). See examples in various frameworks, or read the guide to usage and configuration.

Contribute on Github.

See also: jsonrpcclient