Documentation

Python SDK overview

Use the governed Python SDK in Relpin FastAPI apps.

Beta Updated 2026-06-11 Raw Markdown
Docs tree

The Python SDK supports governed FastAPI apps in Relpin. It gives the app database access through a platform-controlled transport and exposes the preview readiness signal.

Install surface

Relpin templates include the SDK. In generated apps, import from relpin_sdk.

from relpin_sdk import RelpinDb, RelpinReadinessMiddleware

Database access

RelpinDb sends queries over the governed runtime transport. In preview, that transport points at the sidecar. In published Workers, the generated shim uses the runtime DB service binding.

The app does not read DATABASE_URL.

Readiness

FastAPI apps should add RelpinReadinessMiddleware. The preview sidecar uses /__relpin/ready to know when the app imported and can serve the current revision.