JSON-RPC server library.
Project description
Handle JSON-RPC requests.
Write functions to carry out the JSON-RPC requests:
>>> api.register_method(lambda x, y: x + y, 'add')
Then dispatch requests to them:
>>> api.dispatch({'jsonrpc': '2.0', 'method': 'add', 'params': [2, 3], 'id': 1})
({'jsonrpc': '2.0', 'result': 5, 'id': 1}, 200)
The returned values - a JSON-RPC response and an HTTP status code - can be used to respond to a client.
Full documentation is available at https://jsonrpcserver.readthedocs.org/.
Release History
2.0.0 (2015-04-09)
Major update.
The Flask dependency has been removed. So little of the code relied on Flask, so that code was either updated or removed altogether. The library can still be used with Flask with very few changes - see flask-example.py.
The library now works very similarly to Josh Marshall’s jsonrpclib, but is purely for the server-side and has no client, and is just a dispatcher, not a server (despite the name), giving the freedom to be used on a wider range of scenarios.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.