Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

openrpc

Package Overview
Dependencies
Maintainers
1
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.

  • 10.3.9
  • PyPI
  • Socket score

Maintainers
1

Python OpenRPC

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.9+
  • Pydantic for data models.

Installation

OpenRPC is on PyPI and can be installed with:

pip install openrpc

Or with Poetry

poetry add openrpc

Example

This is a minimal OpenRPC server hosted over HTTP and WebSockets using Tabella and uvicorn.

from openrpc import RPCServer
import tabella

rpc = RPCServer(title="DemoServer", version="1.0.0")


@rpc.method()
async def add(a: int, b: int) -> int:
    return a + b


app = tabella.get_app(rpc)

if __name__ == "__main__":
    uvicorn.run(app, host="0.0.0.0", port=8080)

Example In

{
  "id": 1,
  "method": "add",
  "params": {
    "a": 1,
    "b": 3
  },
  "jsonrpc": "2.0"
}

Example Result Out

{
  "id": 1,
  "result": 4,
  "jsonrpc": "2.0"
}

Template App

A template app is available as an example or to clone to bootstrap your RPC server.

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc