Skip to main content

Open-RPC API hosting and interactive documentation.

Project description

Tabella

Open-RPC development framework with builtin interactive documentation.

Demo

Live Demo

A live demo is available here.

Install

Tabella is on PyPI and can be installed with:

pip install tabella

Or with Poetry

poetry add tabella

Python OpenRPC Docs

The RPC server hosted and documented by Tabella is powered by Python OpenRPC. Refer to the Python OpenRPC docs hosted here for advanced use.

Getting Started

A basic Tabella app:

from tabella import Tabella

app = Tabella()


@app.method()
def echo(a: str, b: float) -> tuple[str, float]:
    """Echo parameters back in result."""
    return a, b


if __name__ == "__main__":
    app.run()

Run this, then open http://127.0.0.1:8000/ in your browser to use the interactive documentation.

The Open-RPC API will be hosted over HTTP on http://127.0.0.1:8000/api and over WebSockets on ws://127.0.0.1:8000/api.

Further Usage

Routers

An app with many modules can be organized into segments using Method Routers.

Security and Depends Arguments

Tabella passes request headers to the RPCServer process request methods. Details on usage can be found in the Python OpenRPC docs on Depends Arguments.

Set Servers

Set RPC servers manually to specify transport and paths to host the RPC server on, e.g.

from openrpc import Server
from tabella import Tabella

app = Tabella(
    servers=[
        Server(name="HTTP API", url="http://localhost:8000/my/api/path"),
        Server(name="WebSocket API", url="ws://localhost:8000/my/api/path"),
    ]
)

This app will host the RPCServer over HTTP and over WebSockets with the path /my/api/path.

Pydantic

Pydantic is used for request/response deserialization/serialization as well as schema generation. Pydantic should be used for any models as seen here in the Python OpenRPC Docs.

Starlette

Tabella HTTP and WebSocket server hosting uses Starlette. Uvicorn can be used to run the starlette app.

uvicorn main:app.starlette --reload

Monitor

If you are running the app with in debug mode, e.g. app = Tabella(debug=True), then at the path /monitor there is a display that will show requests and responses made to the RPC server as they happen.

This requires websockets

pip install websockets

Monitor

Inspired By

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

tabella-2.3.24.tar.gz (212.6 kB view details)

Uploaded Source

Built Distribution

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

tabella-2.3.24-py3-none-any.whl (244.5 kB view details)

Uploaded Python 3

File details

Details for the file tabella-2.3.24.tar.gz.

File metadata

  • Download URL: tabella-2.3.24.tar.gz
  • Upload date:
  • Size: 212.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.13.3 Linux/6.14.9-300.fc42.x86_64

File hashes

Hashes for tabella-2.3.24.tar.gz
Algorithm Hash digest
SHA256 45bdc562c2d3caee558d8edd68dd26a2c8fad31e9d3258bc9e0d1072be6baf6e
MD5 d64cacfe995143f45f2e5fa2dd0fdb10
BLAKE2b-256 5238fed0d5bdfdbedd4a2b9cc0080b96791964e65a9a86ff06972f2ab1d667a5

See more details on using hashes here.

File details

Details for the file tabella-2.3.24-py3-none-any.whl.

File metadata

  • Download URL: tabella-2.3.24-py3-none-any.whl
  • Upload date:
  • Size: 244.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.13.3 Linux/6.14.9-300.fc42.x86_64

File hashes

Hashes for tabella-2.3.24-py3-none-any.whl
Algorithm Hash digest
SHA256 9e51d0097f58724a7689e8df904ba10da4ef514e13572bd1fd46b1638fa37ec2
MD5 9462d78372f7e8d53e666037193e0ba4
BLAKE2b-256 6dc3059cd8962059774b384bb9d11d1183d11b55020c78034605d97e03c25fd4

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