Skip to main content

JSON-RPC protocol

Transports:

  • local
  • pipe
  • netstring/TCP
  • HTTP/TCP
  • 0MQ?
import jrproto


def add(a, b):
    return a + b


async def sub(a, b):
    return a - b


server = jrproto.server.local.LocalServer()
server = jrproto.server.tcp.TCPServer(("", 9999))


server.register(add)
server.register(sub)


client = Client()

assert client.request("add", 9, 5) == 14
assert client.notification("add", 9, 5) is None


assert client.add(9, 5) == 14

Message pipeline

        payload          message            response         line
stream ========> unpack ========>  ==> call ========> pack =====> send  [request]
                                   |
                                   | ==> call ---> null                 [notification]
                                   |
                                   | ==> (fill future, callback, etc)   [response]

stream: a stream of payload events payload: a buffer representing a complete JSON-RPC message (request, notification, response) unpack: translate a buffer into a python dict representing JSON-RPC message message: python dict representing JSON-RPC message

Metadata

Release files for jrproto 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jrproto 0.1.0
File Size Uploaded Provenance Actions
jrproto-0.1.0.tar.gz 12.0 kB Without provenance Details for jrproto-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for jrproto 0.1.0
File Interpreter ABI Platform Actions
jrproto-0.1.0-py2.py3-none-any.whl Python 2, Python 3 none any Details for jrproto-0.1.0-py2.py3-none-any.whl

Total release size: 21.6 kB

Release files / jrproto-0.1.0.tar.gz

Download URL jrproto-0.1.0.tar.gz
Size 12.0 kB
Tags Source
SHA-256 checksum
How to use checksums
e66f3d6ce17e84060a398c5a39961601fca912780b322f417df44ea569fdb58a
BLAKE2b-256 checksum
How to use checksums
46c0e9631180da708616fbf30e4297142b5a5ccf24f1fce815bddec617929795
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.9

Release files / jrproto-0.1.0-py2.py3-none-any.whl

Download URL jrproto-0.1.0-py2.py3-none-any.whl
Size 9.6 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
0e40dfe321cc3f702a70c1ca0496c8240b5a3a2d71afe0829359a49cc692a987
BLAKE2b-256 checksum
How to use checksums
05d7725ccaadf667c63e4e70c6af527829ddf55c9b64126e0003ecb47d3d07d0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.9

Security for jrproto 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page