Documentation: https://python-openrpc.burkard.cloud
Source Code: https://gitlab.com/mburkard/openrpc
Python OpenRPC is a transport agnostic framework for quickly and easily developing OpenRPC servers in Python.
Requirements
- Python 3.14+
- Pydantic for data models.
Installation
uv add openrpc
Or
pip install openrpc
Example
This is a minimal OpenRPC server hosted over HTTP using aiohttp.
from aiohttp import web
from openrpc import RPCApp
rpc = RPCApp()
@rpc.method()
async def add(a: int, b: int) -> int:
return a + b
async def api(request: web.Request) -> web.Response:
return web.Response(body=await rpc.process(await request.text()))
if __name__ == "__main__":
app = web.Application()
_ = app.router.add_post("/api", api)
web.run_app(app)
Example In
{
"id": 1,
"method": "add",
"params": {
"a": 1,
"b": 3
},
"jsonrpc": "2.0"
}
Example Result Out
{
"id": 1,
"result": 4,
"jsonrpc": "2.0"
}
Support the Developer
Metadata
Release files for openrpc 11.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| openrpc-11.1.1.tar.gz | 30.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| openrpc-11.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 67.0 kB
Release files / openrpc-11.1.1.tar.gz
| Download URL | openrpc-11.1.1.tar.gz |
|---|---|
| Size | 30.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
68ff1b3914639fce77f2e20b8eaf5036317af4bb5b8766f1f00742b3d3c7b564
|
|
BLAKE2b-256 checksum How to use checksums |
de79ee4def800b417cd0d086655fdd55ea87c202541a6547e2090e93fb36bea4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / openrpc-11.1.1-py3-none-any.whl
| Download URL | openrpc-11.1.1-py3-none-any.whl |
|---|---|
| Size | 36.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7fbd52b3f487bdaafc29d6a72f4d4388ca865297836e538d62524ae9d9eff2ba
|
|
BLAKE2b-256 checksum How to use checksums |
5fc5c9db6ce947ddd303ba83b9b1fe8b0e10f47bacf2056ea934c8e395f82e15
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|