pyRPC
Get Started

Introduction

Welcome to pyRPC - The type-safe, Python-first RPC framework.

PyPI - VersionPyPI - Downloads

pyRPC is a drop-in RPC layer for Python. It turns your backend into a library of typed async functions that can be called from anywhere.

Inspired by the DX of tRPC, pyRPC eliminates the need for OpenAPI schemas, heavy generators, or manual boilerplate.

The Problem

You rename a Python function from get_user to fetch_user. Your TypeScript client silently breaks - no error, no warning, just a runtime failure in production.

That's the reality of maintaining type safety across a Python backend and a TypeScript frontend without a shared contract layer.

The Solution

pyRPC treats your backend as a shared library. It synchronizes your Python procedure signatures directly into TypeScript contracts.

  • No OpenAPI: No intermediate spec files to maintain or sync.
  • No SDKs: No heavy generated code - just clean TypeScript contracts.
  • Pure Types: Your procedures, fully typed, from end-to-end.

Key Features

  • Python-native: Built for asyncio, Pydantic v2, and modern type hints.
  • End-to-End Typing: Request, response, and errors stay in sync automatically.
  • One-command setup: pyrpc dev walks you through configuration and starts everything.
  • Modular: Only install what you need (core, adapters).

How it works

  1. Define: Use the @rpc decorator on any Python function.
  2. Run: pyrpc dev creates a pyrpc.json config, starts the server, and generates types.
  3. Call: Use createClient<Types>() on the frontend with full type safety.

Next Steps