Skip to main content

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


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.1.1.tar.gz (6.9 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