Skip to main content

Transport agnostic framework for developing OpenRPC servers.

Project description

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

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

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-10.3.5.tar.gz (17.7 kB view details)

Uploaded Source

Built Distribution

openrpc-10.3.5-py3-none-any.whl (21.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: openrpc-10.3.5.tar.gz
  • Upload date:
  • Size: 17.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.9.17 Linux/5.15.154+

File hashes

Hashes for openrpc-10.3.5.tar.gz
Algorithm Hash digest
SHA256 288fb584e0e35c271d5711ccf26009a44212ca3148b5a5ff37d81970872215a8
MD5 cb31d0db4aaa2a5505cce08f7502aeb1
BLAKE2b-256 077227b66d505d265bb8215a8e62c1690e4c5612b21736df2a6fa113eec8c73c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: openrpc-10.3.5-py3-none-any.whl
  • Upload date:
  • Size: 21.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.9.17 Linux/5.15.154+

File hashes

Hashes for openrpc-10.3.5-py3-none-any.whl
Algorithm Hash digest
SHA256 0bbebfb169cbbab47ce91fc27d4f7e28d99d54a562a63dd52697a8a21f5e6463
MD5 48c96f7b7ca6d66e48b224aa57e5d6fc
BLAKE2b-256 1d4c22d0a65a50fbefbd7d400861c928481b1fd8ee4901c4da7e75f0e0faa48c

See more details on using hashes here.

Supported by

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