Process incoming JSON-RPC 2.0 requests in Python
Maintained. Last release 3 weeks ago, commits in 6 of the last 26 weeks. Weaker on contributor spread.
pip install jsonrpcserver
Process incoming JSON-RPC 2.0 requests in Python
Documentation | API reference | Examples | Changelog | Migration
jsonrpcserver takes a JSON-RPC 2.0 request, calls your Python function and gives you the response to send back. It leaves the networking to you, so it fits into whatever server you already have.
Features
- Works with any framework or transport. The docs have tested examples for http.server, Flask, Werkzeug, Django, FastAPI, aiohttp, Sanic, Tornado, websockets, ZeroMQ and Socket.IO.
- Sync and async:
dispatchandasync_dispatch. Withasync_dispatch, the requests in a batch run concurrently. - Follows the spec for batches, notifications and errors, and checks each request's params against your function's signature.
- Keeps exception messages out of responses and in your logs, and limits batch size with (from 5.0.10).