A collection of objects for use in JSON-RPC 2.0 implementations.
Project description
JSON-RPC 2.0 Objects
A collection of objects for use in JSON-RPC 2.0 implementations.
Installation
pip install jsonrpc2-objects
Objects
Available in objects
are the following:
Object | Description |
---|---|
RequestObjectParams | Request with params |
RequestObject | Request without params |
NotificationObjectParams | Notification with params |
NotificationObject | Notification without params |
ErrorResponseObject | Response with result |
ResultResponseObject | Response with error |
Errors
Python exceptions are available for each JSON-RPC 2.0 error.
Each error extends JSONRPCError
.
Example use with a client implementing these errors:
from jsonrpcobjects.errors import JSONRPCError, MethodNotFound
try:
client.example_method(params)
except MethodNotFound:
print("Handle method not found")
except JSONRPCError:
print("Handle any JSON RPC error.")
JSON Types
Type hints are provided for the following JSON types.
- JSONPrimitive
- JSONArray
- JSONObject
- JSONStructured
- JSON
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
jsonrpc2-objects-2.0.0.tar.gz
(15.5 kB
view hashes)
Built Distribution
Close
Hashes for jsonrpc2_objects-2.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e242d8bc4ad26e981c8bcd6b8f49ae7febde1d5a1104ee177e29230000c1a06 |
|
MD5 | 0a4af850c91f87b43f769f0517efd6a6 |
|
BLAKE2b-256 | a52f21631c849dff2bf5752dd0b6ef12556174a646aefd8ab5f8b1e1e23d8cbf |