ajsonrpc
Async JSON-RPC 2.0 protocol + server powered by asyncio
What it is and what it does
ajsonrpc is a lightweight, dependency-free implementation of the JSON-RPC 2.0 protocol built on asyncio. It provides core primitives (request, response, error objects), a dispatcher for mapping method names to callables, and an asynchronous manager that handles request parsing, error generation, and batch execution. The package also includes a minimal asyncio-based server that can expose Python methods directly via runtime introspection, requiring zero framework integration.
The library is designed as a successor to the json-rpc package by the same team, with similar APIs but async-first architecture. It handles both single and batch JSON-RPC requests, supports custom error classes, and offers backend adapters for Tornado, Sanic, and Quart. Because JSON-RPC 2.0 is intentionally simple (single endpoint, no routing), the package can operate as a self-contained server without Django, Flask, or other web frameworks.
Use it for:
- Build a standalone JSON-RPC 2.0 API server using only asyncio, with methods exposed via a Python file and the included CLI tool.
- Integrate JSON-RPC 2.0 protocol handling into an existing asyncio application without adding external dependencies.
- Create a dispatcher to route incoming RPC method calls to class methods, functions, or lambda expressions in a type-safe way.
- Handle batch JSON-RPC requests with parallel execution and proper error reporting for each request in the batch.
- Wrap application methods for use with Tornado, Sanic, or Quart backends using the provided adapter layer.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Implements the JSON-RPC 2.0 protocol with an asynchronous request manager and minimal asyncio-based server, requiring no external dependencies.
Yes, if you need a lightweight, dependency-free JSON-RPC 2.0 implementation for asyncio-based applications. The permissive MIT license and zero external dependencies make it low-risk to adopt. However, be aware that the project is abandoned—last release was July 2021 with no recent commits. Install only if you do not require active maintenance or compatibility updates beyond Python 3.9.
Install
ajsonrpc on PyPI
pip
pip install ajsonrpcuv
uv add ajsonrpcpoetry
poetry add ajsonrpcInstalling ajsonrpc
Before you install
Low install friction with no runtime dependencies. Maintenance is stalled—last release was 2021-07-21 and the repository shows no recent activity, though it remains archived=false. Suitable for stable, self-contained use cases where no active updates are expected.
License in practice
MIT license (permissive) allows commercial and private use with minimal restrictions, making it safe to adopt from a licensing standpoint.
Quickstart
pip install ajsonrpc
from ajsonrpc import Dispatcher, Manager
dispatcher = Dispatcher({"sum": lambda a, b: a + b})
manager = Manager(dispatcher)
# For async usage:
await manager.get_response_for_payload('{"jsonrpc": "2.0", "method": "sum", "params": [2, 3], "id": 1}')
Requires Python 3.5 or later; asyncio event loop must be running for async methods.
Verify before relying
- Whether the package remains compatible with Python versions beyond 3.9 (classifiers list only up to 3.9).
- Current state of the Tornado, Sanic, and Quart backend integrations mentioned in the description.
- Whether the included async-json-rpc-server CLI tool is actively maintained or functional.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.5) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 1,850 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,074,646/month — #3,317 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: ajsonrpc-1.2.0-py3-none-any.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
json-rpcImplements JSON-RPC 2.0 and 1.0 protocol…
permissive · top 5,000 on PyPI
jsonrpcclientGenerates JSON-RPC request objects and parses…
unclear · top 15,000 on PyPI
python-bitcoinrpcProvides a JSON-RPC client library for…
copyleft · top 15,000 on PyPI
python-lsp-jsonrpcImplements a JSON RPC 2.0 server for Python…
permissive · top 5,000 on PyPI
thriftpy2ThriftPy2 is a pure Python implementation of…
permissive · top 5,000 on PyPI
nexus-rpcNexus Python SDK provides a framework for…
permissive · top 1,000 on PyPI
transmission-rpcPython wrapper around the Transmission…
permissive · top 15,000 on PyPI
github-copilot-sdkPython SDK for programmatic control of GitHub…
permissive · top 5,000 on PyPI
python-oscpython-osc implements Open Sound Control (OSC)…
unclear · top 15,000 on PyPI
OdooRPCOdooRPC is a Python client library that…
copyleft · top 15,000 on PyPI