Create JSON-RPC 2.0 requests and parse responses in Python
Actively maintained. Last release 3 weeks ago, commits in 6 of the last 26 weeks. A safe choice.
pip install jsonrpcclient
Create JSON-RPC 2.0 requests and parse responses in Python
Documentation | API reference | Examples | Changelog | Migration
jsonrpcclient builds JSON-RPC 2.0 requests and parses the responses. It doesn't send anything, so it works with any transport: HTTP, websockets, ZeroMQ, or something of your own.
Features
- Builds requests for any transport. You send them with the library you already use.
- No dependencies outside the standard library.
- Typed, with a
py.typedmarker. The package passes mypy and pyright in strict mode. - Requests, notifications and batches, with ids that count up or are hex, random or UUID strings.
- Id generators are safe to share between threads, and CI runs the tests on free-threaded Python 3.14t.
- A malformed response raises
InvalidResponsewith a message saying what's wrong, such as (new in 4.1.0).