Transport agnostic framework for developing OpenRPC servers.
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file openrpc-11.0.1.tar.gz.
File metadata
- Download URL: openrpc-11.0.1.tar.gz
- Upload date:
- Size: 30.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de2d879670ccd9991c1058cd0392efe4ddf68dac1100e8e01e4dddb26032f552
|
|
| MD5 |
f4fe9f9e77c6823865f57e1a48c745c0
|
|
| BLAKE2b-256 |
66f0eacc71f87633ca3cc6a6229aa7ded083c3441a98074c7205b88e484aa87e
|
File details
Details for the file openrpc-11.0.1-py3-none-any.whl.
File metadata
- Download URL: openrpc-11.0.1-py3-none-any.whl
- Upload date:
- Size: 35.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
96dd6cfa74a738e52bf9aaa25085cea8561f2ac85539d82b415a40b6a770f5be
|
|
| MD5 |
2dae35ccf7621b31b4d51d2e3a64e9e1
|
|
| BLAKE2b-256 |
10666afb943ba63635a2f19648939a798bae9736aa45b1822a1567d9bb9cdd31
|