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 details)
Built Distribution
File details
Details for the file jsonrpc2-objects-2.0.0.tar.gz
.
File metadata
- Download URL: jsonrpc2-objects-2.0.0.tar.gz
- Upload date:
- Size: 15.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.12 CPython/3.9.7 Linux/5.15.15-76051515-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8f094a29523ca0a70e86b135d700739816edd9be716a928da96e37bf86e8cd9 |
|
MD5 | a720ed943cca8a38de72475ea20d332f |
|
BLAKE2b-256 | a48c1997d4835a753e147f805fa5863b8bb1cd07f517194c0bd594a6a41a8d8a |
File details
Details for the file jsonrpc2_objects-2.0.0-py3-none-any.whl
.
File metadata
- Download URL: jsonrpc2_objects-2.0.0-py3-none-any.whl
- Upload date:
- Size: 16.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.12 CPython/3.9.7 Linux/5.15.15-76051515-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e242d8bc4ad26e981c8bcd6b8f49ae7febde1d5a1104ee177e29230000c1a06 |
|
MD5 | 0a4af850c91f87b43f769f0517efd6a6 |
|
BLAKE2b-256 | a52f21631c849dff2bf5752dd0b6ef12556174a646aefd8ab5f8b1e1e23d8cbf |