Skip to main content

A collection of objects for use in JSON-RPC 2.0 implementations.

Project description

Code style: black

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 client:

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


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-1.3.6.tar.gz (15.8 kB view details)

Uploaded Source

File details

Details for the file jsonrpc2-objects-1.3.6.tar.gz.

File metadata

  • Download URL: jsonrpc2-objects-1.3.6.tar.gz
  • Upload date:
  • Size: 15.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.5

File hashes

Hashes for jsonrpc2-objects-1.3.6.tar.gz
Algorithm Hash digest
SHA256 55a961179ec2b9f741036d9aaa25e8fc4cf12ca12cbf02b1c6146e96206e5c7c
MD5 7aaa997c0af3c899e83ecec6e659ffd1
BLAKE2b-256 a8e88fe54a3ed1a55634a8cb9d4add5a0ac95b5aee9db484128b2f5f12f103f8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page