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


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)

Uploaded Source

Built Distribution

jsonrpc2_objects-2.0.0-py3-none-any.whl (16.1 kB view details)

Uploaded Python 3

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

Hashes for jsonrpc2-objects-2.0.0.tar.gz
Algorithm Hash digest
SHA256 e8f094a29523ca0a70e86b135d700739816edd9be716a928da96e37bf86e8cd9
MD5 a720ed943cca8a38de72475ea20d332f
BLAKE2b-256 a48c1997d4835a753e147f805fa5863b8bb1cd07f517194c0bd594a6a41a8d8a

See more details on using hashes here.

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

Hashes for jsonrpc2_objects-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9e242d8bc4ad26e981c8bcd6b8f49ae7febde1d5a1104ee177e29230000c1a06
MD5 0a4af850c91f87b43f769f0517efd6a6
BLAKE2b-256 a52f21631c849dff2bf5752dd0b6ef12556174a646aefd8ab5f8b1e1e23d8cbf

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