JSON-RPC server library.
Project description
Handle incoming JSON-RPC requests in Python 2.7 and 3.3+.
Write functions to carry out 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/.
Recent Changes
2.1.1 (2015-09-06)
Properly handle invalid JSON in dispatch_str()
2.1.0 (2015-09-06)
Debug mode can now be enabled by setting a flag on the dispatcher. This allows extra (potentially sensitive) information to be included in the response message to the client. The previous method, passing ``more_info=True`` to the dispatch method, has been removed.
2.0.2 (2015-09-04)
Faster request validation. (#23)
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.