Skip to main content

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.1 (2015-05-09)

  • Fixed logging, now allows you to add handlers to getLogger(‘jsonrpcserver’). See docs for info.

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jsonrpcserver-2.0.1.tar.gz (6.4 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page