pRPC is a modern, tRPC-inspired "drop-in RPC layer" for Python. It's designed to be dead simple, type-safe, and framework-agnostic.
Inspired by giving you the best DX, pRPC focuses on giving you a type-safe bridge between your backend and frontend without forcing a specific architecture or framework.
- Dead simple install: Zero config, zero ceremony.
- Works everywhere: Plugs into FastAPI, Flask, or any ASGI server.
- Batteries included but modular: Install only what you need.
- Type-safe bridge: Get a tRPC-like experience with Python and TypeScript.
pRPC follows a modular packaging strategy. You only pay for what you use.
The tiny core protocol and runtime.
uv add prpc
# or
pip install prpcInstall the adapter for your favorite framework.
FastAPI
uv add prpc-fastapiFlask
uv add prpc-flaskTools for generating TypeScript clients.
uv add prpc-codegenDefine your procedures and mount the RPC layer.
from prpc import rpc
from prpc_fastapi import mount_fastapi
from fastapi import FastAPI
app = FastAPI()
@rpc
def add(a: int, b: int) -> int:
return a + b
mount_fastapi(app)Call your procedures with full type support and dynamic method discovery.
from prpc import RPCClient
with RPCClient("http://localhost:8000") as client:
result = client.add(10, 5)
print(f"Result: {result}")Use the CLI to generate a type-safe TS client.
prpc codegen -m my_app.main -o client.tsThe prpc command (provided by prpc-codegen) allows you to:
prpc serve: Instantly host an RPC module.prpc inspect: Visualize all registered procedures.prpc codegen: Generate frontend clients.
Check out the examples/ directory for complete server and client implementations.
MIT
prpc --help