Skip to main content

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

Buy Me a Coffee

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openrpc-11.0.0.tar.gz (30.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openrpc-11.0.0-py3-none-any.whl (35.6 kB view details)

Uploaded Python 3

File details

Details for the file openrpc-11.0.0.tar.gz.

File metadata

  • Download URL: openrpc-11.0.0.tar.gz
  • Upload date:
  • Size: 30.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.6 {"installer":{"name":"uv","version":"0.10.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"43","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for openrpc-11.0.0.tar.gz
Algorithm Hash digest
SHA256 f238324312e5adb07861cf36865ad6c03f512ca4a330fc837caf77d4742688e3
MD5 c069dbb14fe0515307050ec475a58c52
BLAKE2b-256 6e05fc4a8e6d49a21417f99c03c825b0175cfc491f912692ecfffe0f2ff5b925

See more details on using hashes here.

File details

Details for the file openrpc-11.0.0-py3-none-any.whl.

File metadata

  • Download URL: openrpc-11.0.0-py3-none-any.whl
  • Upload date:
  • Size: 35.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.6 {"installer":{"name":"uv","version":"0.10.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"43","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for openrpc-11.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 26c59c173afe37c0027891ec5b985dcb065d84d06d45bfa5fb990c11ca8cb323
MD5 779a95a2a231c49e9d753d38e1bda3c5
BLAKE2b-256 d5bedb8b5d9d765cdf3eebe92ab3ccb2a55327d767e2f461fc7620cdce984fd5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page