Skip to main content

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, ui_path="/reference").

Options

Option Default
ui_path /docs URL path the reference page is served at, within the app. path is its old name, still read
spec_url the app's openapi_url URL of the OpenAPI document, which the browser fetches when the page opens. A path starting with / is a path of the app
spec The OpenAPI document itself (a dict or JSON text), written into the page so the browser makes no request for it. With both, spec is shown and spec_url is the download link
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 {ui_path}/oauth-receiver.html, which the app serves on its own origin, also with assets="cdn".

  • examples/app.py is a complete app.

  • The package itself requires no framework; rapidoc.fastapi uses the Starlette that FastAPI installs. rapidoc.contract is 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.

Releasing (for maintainers)

Releases go to PyPI from GitHub Actions, through a trusted publisher. There is no token and nothing to upload by hand.

  1. Set the version. Raise version in pyproject.toml. PyPI refuses a version number that already exists.

  2. Choose the bundle. To ship a newer RapiDoc, put its npm version in RAPIDOC_VERSION. The wheel carries exactly that release of rapidoc-min.js. Leave the file alone for a release that only changes the Python code.

  3. Check locally (optional; the workflow runs the same steps):

    python scripts/sync_assets.py --npm
    python -m pytest
    
  4. Merge to master. The "Python package" workflow runs the tests on the oldest and newest supported Python.

  5. Publish. On GitHub, open Actions, choose Python package, click Run workflow, tick Publish the version in pyproject.toml to PyPI, and run it on master. It tests, builds, checks that the wheel contains the bundle, and uploads.

  6. Verify. pip install rapidoc==<version> in a clean environment, and check https://pypi.org/project/rapidoc/.

Which number to raise: a fix or a newer bundle is a patch (0.1.1); a new option or a new framework module is a minor (0.2.0). While the version is 0.x, a change that breaks existing code is also a minor, and is called out in the release notes.

The trusted publisher on PyPI is tied to the workflow file .github/workflows/publish-python.yml and the GitHub environment pypi. Renaming either stops publishing until the publisher is updated under the project's Publishing settings on PyPI.

Metadata

Release files for rapidoc 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rapidoc 0.1.1
File Size Uploaded Provenance Actions
rapidoc-0.1.1.tar.gz 186.9 kB With provenance Details for rapidoc-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rapidoc 0.1.1
File Interpreter ABI Platform Actions
rapidoc-0.1.1-py3-none-any.whl Python 3 none any Details for rapidoc-0.1.1-py3-none-any.whl

Total release size: 373.6 kB

Release files / rapidoc-0.1.1.tar.gz

Download URL rapidoc-0.1.1.tar.gz
Size 186.9 kB
Tags Source
SHA-256 checksum
How to use checksums
7900cd933a8a39bafcfec4d1512a5a4aae3a9763e73991091cb1adfa0ddfc230
BLAKE2b-256 checksum
How to use checksums
f4ac9f16ba971ce3f19d9f4a1ecd525c4af956850ff250839ad4e3b334ac7983
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 log

Release files / rapidoc-0.1.1-py3-none-any.whl

Download URL rapidoc-0.1.1-py3-none-any.whl
Size 186.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
10820cecebdae1875a64f98b53f1ae2bdd25cf79d0ecd04a84fc430804a02d1e
BLAKE2b-256 checksum
How to use checksums
07cffee76f3a23b85ce5c678d1d17a2034089d6900fe6d2f31cbe3ce669b08dc
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 log

Security for rapidoc 0.1.1

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.

Select from 2 files

Attestation for rapidoc-0.1.1.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 log

A 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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page