This is a compact and simple JSON-RPC client implementation interface python code. This code is forked from https://github.com/gciotta/jsonrpc-requests
- Python 3.6, 3.7, 3.8 & 3.9 compatible
- Supports nested namespaces (eg. app.users.getUsers())
- 100% test coverage
See jsonrpc-async and jsonrpc-websocket for example implementations.
Install the Python tox package and run tox
, it'll test this package with various versions of Python.
- Unpin test dependencies
- Use uuid4 for request IDs
- BREAKING CHANGE: Allow single mapping as a positional parameter.
Previously, when calling with a single dict as a parameter (example:
server.foo({'bar': 0})
), the mapping was used as the JSON-RPC keyword parameters. This made it impossible to send a mapping as the first and only positional parameter. If you depended on the old behavior, you can recreate it by spreading the mapping as your method's kwargs. (example:server.foo(**{'bar': 0})
)
- Support for async server request handlers
- Falsey values are no longer treated as None for message IDs, or request parameters.
@gciotta for creating the base project jsonrpc-requests.
@mbroadst for providing full support for nested method calls, JSON-RPC RFC compliance and other improvements.
@vaab for providing api and tests improvements, better RFC compliance.