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
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.014s · 18.2MB
glibcpy 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)
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.
fixUpgrade 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.
fixpip 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.
fixUse 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.