API versioning for FastAPI web applications. The current version is 0.10.0, with no recent releases; the library appears to be in maintenance mode. Supports header, hostname, URL prefix, and query parameter versioning schemes. Requires Python >=3.6 and FastAPI.
Install & Compatibility
Where this runs
tested against v0.10.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 1.338s · 31.9MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 3.7s · import 1.214s · 32MB
30MB installed
● package 30MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Old import path no longer works.
from fastapi_versioning import VersionedFastAPI
Direct import from top-level package.
from fastapi_versioning import version
Minimal example using decorator-based versioning with URL prefix.
from fastapi import FastAPI
from fastapi_versioning import VersionedFastAPI, version
app = FastAPI()
@version(1, 0)
@app.get("/")
def read_root():
return {"Hello": "v1"}
app = VersionedFastAPI(app, version_format="{major}.{minor}", prefix_format="/v{major}.{minor}")
Upgrade
Version history
Breaking-change detection hasn't run for this library yet.
Audit
Security & dependencies
CVE tracking and dependency tree are planned for a later release.