rapidoc (Python)
Serves a RapiDoc API reference from a FastAPI or Starlette app: an interactive page for your OpenAPI document, with a console to try requests.
pip install rapidoc
from fastapi import FastAPI
from rapidoc.fastapi import setup_rapidoc
app = FastAPI(docs_url=None, redoc_url=None)
setup_rapidoc(app)
Open /docs. The page reads the app's own /openapi.json, and nothing is loaded from another site: the package carries the RapiDoc bundle.
FastAPI serves Swagger UI at /docs unless you create the app with docs_url=None. To keep Swagger UI, give RapiDoc another path: setup_rapidoc(app, path="/reference").
Options
| Option | Default | |
|---|---|---|
path |
/docs |
Where the reference is served, within the app |
spec_url |
the app's openapi_url |
URL of the OpenAPI document. A path starting with / is a path of the app |
spec |
The OpenAPI document itself (a dict or JSON text), written into the page | |
title |
the app's title + "API Reference" | Page title |
assets |
"bundled" |
"bundled": the app serves rapidoc-min.js. "cdn": the browser loads the same version from jsDelivr, checked against its SRI hash. {"script_url": ..., "integrity": ...}: a URL of your own |
options |
Attributes of <rapi-doc>: {"render_style": "focused", "allow_try": False}. Names can be written with underscores, hyphens or in camelCase |
|
head, css |
Markup and CSS added to the page as given | |
lang |
en |
Language of the page |
nonce |
Content-Security-Policy nonce, or a function that takes the request and returns it | |
enabled |
True |
False adds nothing, for example outside development |
These are the options of every RapiDoc integration, in Python naming.
Behind a proxy
When a proxy strips a path prefix, run the app with that prefix as its root_path (uvicorn app:app --root-path /api, or FastAPI(root_path="/api")). The page then uses the prefix for the bundle, the OpenAPI document and the OAuth return page, as FastAPI's own docs do.
Starlette
from rapidoc.starlette import setup_rapidoc is the same function, for any Starlette app. Starlette has no OpenAPI endpoint of its own, so pass spec_url or spec.
Notes
-
Each release ships one version of
rapidoc:rapidoc.rapidoc_version(). -
The routes are left out of the app's OpenAPI document.
-
OAuth sign-in returns to
{path}/oauth-receiver.html, which the app serves on its own origin, also withassets="cdn". -
examples/app.pyis a complete app. -
The package itself requires no framework;
rapidoc.fastapiuses the Starlette that FastAPI installs.rapidoc.contractis the RapiDoc integration contract in plain Python, for building an integration for another framework.
Python 3.10 or later; Starlette 0.27 or later. MIT.
Metadata
Release files for rapidoc 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| rapidoc-0.1.0.tar.gz | 186.0 kB | With provenance | Details for rapidoc-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| rapidoc-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for rapidoc-0.1.0-py3-none-any.whl |
Total release size: 371.7 kB
Release files / rapidoc-0.1.0.tar.gz
| Download URL | rapidoc-0.1.0.tar.gz |
|---|---|
| Size | 186.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
425f057ddda33d055d9f15a4453ac8ea4b4e392ec9cdff52a1ffdb2dcbd778a3
|
|
BLAKE2b-256 checksum How to use checksums |
65254702b5f3613925d9a6277d333035b8d68e89fbc87838ba2f36812ea2cd39
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.
Transparency logRelease files / rapidoc-0.1.0-py3-none-any.whl
| Download URL | rapidoc-0.1.0-py3-none-any.whl |
|---|---|
| Size | 185.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6b6d358468564aa343c97f0103e0aaffbac1fba3949b9f332d6654c040bf50e9
|
|
BLAKE2b-256 checksum How to use checksums |
3a864aece4f9b6dd00213d3bd47931717628af010b23771052f5cd56b71249a5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.
Transparency logSecurity for rapidoc 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for rapidoc-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.