Overview

Consuming your pyRPC API.

Client

This section shows how to call your pyRPC server from different client environments.

What You'll Learn

  • TypeScript - End-to-end typed contracts with full IDE autocompletion.
  • Links - Transport configuration: httpLink and httpBatchLink.
  • Adapters - React, Next.js, Vue, and Svelte on TanStack Query.
  • Vanilla Python - Dynamic, codegen-free client for scripts and microservices.
  • Advanced - Testing, customization, and patterns.

Quick Example (Python)

from pyrpc_core import RPCClient

with RPCClient("http://localhost:8000") as client:
    result = client.add(a=10, b=5)
    print(result)  # 15

If your server exposes more procedures (via @rpc), they appear as dynamic methods on client.