🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

openrpc

Package Overview
Dependencies
Maintainers
1
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

openrpc

Transport agnostic framework for developing OpenRPC servers.

pipPyPI
Version
11.0.1
Maintainers
1

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

Buy Me a Coffee

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts