fastapi-offline
FastAPI without reliance on CDNs for docs
What it is and what it does
FastAPI-offline is a drop-in replacement for FastAPI that bundles Swagger UI and Redoc documentation assets locally instead of fetching them from external CDNs. This solves the problem of API documentation becoming inaccessible in disconnected networks, air-gapped environments, or situations where external CDN access is restricted or unreliable.
The package automates what the official FastAPI documentation describes as a manual process: it includes the necessary JavaScript and CSS files for both Swagger and Redoc, serves them locally, and configures a FastAPI instance to use them. You instantiate FastAPIOffline instead of FastAPI, optionally customize the static asset path or favicon, and everything else works as normal—all FastAPI options pass through unchanged.
Use it for:
- Running FastAPI services in air-gapped or disconnected networks where external CDN access is unavailable or forbidden.
- Deploying API documentation in environments with strict network policies or firewall rules that block CDN domains.
- Ensuring API docs remain accessible even if external CDN services experience outages or performance degradation.
- Building self-contained Docker images or offline-first deployments where all dependencies must be bundled locally.
- Customizing documentation UI appearance by serving your own favicon alongside the standard Swagger and Redoc interfaces.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Replaces FastAPI's CDN-dependent documentation UI with locally-served Swagger and Redoc assets, enabling API docs to work on disconnected or air-gapped networks.
Yes. If you need FastAPI documentation to work without CDN access, this package solves that problem with minimal friction—a single dependency, permissive licensing, active maintenance, and a straightforward API. Install it when disconnected networks, air-gapped deployments, or strict network policies make CDN-dependent docs impractical.
Install
fastapi-offline on PyPI
pip
pip install fastapi-offlineuv
uv add fastapi-offlinepoetry
poetry add fastapi-offlineInstalling fastapi-offline
Before you install
Low friction: single runtime dependency (fastapi), pure Python wheel distribution. Active maintenance with a recent release (56 days ago) and an archived repository status of false.
License in practice
MIT-licensed code with permissive terms; includes Apache 2.0 Swagger and MIT-licensed Redoc and favicon assets bundled in the package. All original licenses and copyrights are preserved.
Quickstart
pip install fastapi-offline
from fastapi_offline import FastAPIOffline
app = FastAPIOffline()
@app.get("/")
async def root():
return {"message": "Hello World"}
Requires Python 3.8 or later.
Verify before relying
- Whether static asset serving works correctly behind reverse proxies or non-root paths beyond the documented static_url parameter.
- Performance impact of serving bundled documentation assets compared to CDN delivery in typical deployments.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — fastapi |
| Maintenance | actively maintained — 56 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 309,355/month — #7,755 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: fastapi_offline-1.7.7-py3-none-any.whl
Tags
More Dynamic Content packages
MarkupSafe provides a text object that escapes…
permissive · top 100 on PyPI
Jinja2Jinja2 is a templating engine that renders…
permissive · top 100 on PyPI
soupsieveSoupsieve is a CSS selector library designed to…
permissive · top 100 on PyPI
WerkzeugWerkzeug is a WSGI utility library providing…
permissive · top 1,000 on PyPI
FlaskFlask is a lightweight WSGI web application…
permissive · top 1,000 on PyPI
MakoMako compiles Python-embedded templates into…
permissive · top 1,000 on PyPI
drf-spectacular-sidecarServes pre-built Swagger UI and Redoc…
permissive · top 5,000 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
flask-openapi3-swaggerProvides Swagger UI integration for…
permissive · top 15,000 on PyPI
mkdocs-render-swagger-pluginRenders Swagger and OpenAPI schemas as…
permissive · top 15,000 on PyPI
mkdocs-swagger-ui-tagA MkDocs plugin that embeds Swagger UI directly…
permissive · top 15,000 on PyPI
fastapi-auth0Integrates Auth0 authentication into FastAPI…
permissive · top 15,000 on PyPI
fastapi-slimThis package is a deprecated migration shim…
permissive · top 15,000 on PyPI
aiohttp-swagger3Integrates OpenAPI 3 documentation and request…
permissive · top 15,000 on PyPI
scalar-fastapiServes interactive, browser-based API…
permissive · top 5,000 on PyPI
sphinxcontrib-redocA Sphinx extension that embeds OpenAPI…
permissive · top 15,000 on PyPI