Registry / http-networking / tinyrpc

tinyrpc

JSON →
library1.1.7pypypi✓ verified 89d ago

A small, modular, transport and protocol neutral RPC library supporting JSON-RPC (2.0, 1.0), zmq, and more. Current version 1.1.7. Low release cadence.

pip install tinyrpc
INSTALL
IMPORT
SIG · TINYRPC
T
tinyrpc
http-networkingpythonv1.1.7
Install
1.6s avg
Import
14ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v1.1.7 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.014s · 18.2MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 1.6s · import 0.014s · 19MB
16MB installed
● package 16MB
Code
Verified usage

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

RPCClient
✓ from tinyrpc import RPCClient
✗ from tinyrpc.client import RPCClient
RPCClient is exposed via tinyrpc top-level, not submodule.
JSONRPCProtocol
✓ from tinyrpc.protocols.jsonrpc import JSONRPCProtocol
✗ from tinyrpc.jsonrpc import JSONRPCProtocol
JSONRPCProtocol lives in tinyrpc.protocols.jsonrpc.
ServerDispatcher
✓ from tinyrpc.dispatch import RPCDispatcher
✗ from tinyrpc.server import ServerDispatcher
The dispatcher is RPCDispatcher, not ServerDispatcher.
ServerError
✓ from tinyrpc.exc import RPCError
✗ from tinyrpc import ServerError
tinyrpc uses RPCError base class, not ServerError.

Quickstart: create a JSON-RPC client via HTTP.

from tinyrpc import RPCClient from tinyrpc.protocols.jsonrpc import JSONRPCProtocol from tinyrpc.transports.http import HttpPostClientTransport client = RPCClient(JSONRPCProtocol(), HttpPostClientTransport('http://localhost:5000/api')) result = client.call('add', x=1, y=2) print(result)
Debug
Known issues
gotchaThe library is very lightly maintained. Many issues remain open; consider it stable but not actively developed.
fix
Test thoroughly before depending on it for critical systems.
affects: all
gotchaJSON-RPC 2.0 is supported but not all edge cases (e.g., batch requests) are handled correctly.
fix
Use other libraries (e.g., jsonrpcclient) if you need robust batch handling.
affects: <=1.1.7
gotchaThe library uses its own exception classes; standard JSON-RPC error object mapping is partial.
fix
Catch RPCError from tinyrpc.exc instead of expecting standard error dictionaries.
affects: all
Errors
Common errors & fixes
ImportError: cannot import name 'RPCClient' from 'tinyrpc'
Installed version is very old (pre-1.0) or import path used is wrong.
fix
Upgrade to latest: pip install --upgrade tinyrpc. Use correct import: from tinyrpc import RPCClient.
ModuleNotFoundError: No module named 'tinyrpc.transports.http'
HTTP transport is provided by an extra (tinyrpc[http]) not installed by default.
fix
pip install tinyrpc[http] to get the HTTP transport.
TypeError: __init__() got an unexpected keyword argument 'post'
User tried to pass a 'post' argument to HttpPostClientTransport; wrong parameter name.
fix
Use correct constructor: HttpPostClientTransport(endpoint) (no keyword).
Upgrade
Version history
1.1.7latest on PyPI · released Jul 26, 2023
Audit
Dependencies

No dependency data recorded yet.

Agent activity
27 hits · last 30 days
node
22
OpenAI (training)
1
Resources
tinyrpc — pip install tinyrpc · libregistry