Registry / http-networking / python-jsonrpc-server

python-jsonrpc-server

JSON →
library0.4.0pypypiunverified

A JSON RPC 2.0 server library for Python, used primarily by language servers like the Python Language Server. Current version 0.4.0, with infrequent updates. Supports concurrent request handling via futures.

http-networkingserializationweb-framework
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

from pyls_jsonrpc.manager import JSONRPC2Protocol

Basic JSON RPC 2.0 server that reads from stdin and writes to stdout, handling a 'hello' method.

import asyncio from jsonrpc.server import JSONRPC2Server from jsonrpc.manager import JSONRPC2Protocol async def handle_request(protocol, data): request = protocol.parse_request(data) if request.method == "hello": response = protocol.create_response(request, "world") return response.serialize() else: error = protocol.create_error_response(request, -32601, "Method not found") return error.serialize() server = JSONRPC2Server(handle_request) asyncio.run(server.run()) print("Server running on stdin/stdout")
Debug
Known footguns
breakingIn version 0.3.0, the built-in `json` module was replaced with `ujson`. This may cause compatibility issues if your code depends on custom JSON encoders/decoders or uses different JSON library features. `ujson` is not available by default on Windows; install it separately or use a workaround.
gotchaThe library's protocol expects a specific JSON RPC 2.0 format. If you send malformed requests (e.g., missing 'jsonrpc' field or invalid id), the server may hang or raise cryptic errors.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
0 hits · last 30 days

No traffic data recorded yet.

Resources