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.

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

Uploaded Source

Built Distribution

tabella-2.0.0-py3-none-any.whl (235.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tabella-2.0.0.tar.gz
  • Upload date:
  • Size: 206.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.10.12 Linux/6.5.6-76060506-generic

File hashes

Hashes for tabella-2.0.0.tar.gz
Algorithm Hash digest
SHA256 9cbe47dc4089a248a483760f52626ee29964d3822a630777d8c7f1f999d1e876
MD5 aa949a0b056fda841cebdf8ff169430b
BLAKE2b-256 3f69f6b783138fcedc5966b43fcbeef3e1ebb8ad0d41ac61b6ec766bd9293061

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tabella-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 235.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.10.12 Linux/6.5.6-76060506-generic

File hashes

Hashes for tabella-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a8921120984749d95d6c19a9fb064912d787dccb6b5aa694e908dfa38cef8017
MD5 3a78964a12259ea30c1e8552b6c2960c
BLAKE2b-256 05ca4fecb1b9c4ca31ef16a59fa596d4f6f160566fb69031c1d0373b0d8d25d3

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