cadwyn
Production-ready community-driven modern Stripe-like API versioning in FastAPI
What it is and what it does
Cadwyn is a FastAPI extension that implements Stripe-style API versioning, where you write only the newest API version and let the framework generate older versions automatically. Instead of maintaining separate code paths for each version, you define small, focused "version change" modules that describe what changed between versions—Cadwyn then applies these transformations to responses and requests to support multiple API versions from a single implementation.
The package is built on FastAPI, Pydantic, and Starlette, and targets developers who need to support many API versions long-term while keeping business logic clean and version-agnostic. It's marked as production-stable and actively maintained, with comprehensive documentation covering both practical setup and the theory behind migration-based versioning.
Use it for:
- Maintain a public API that supports 3+ versions simultaneously without duplicating endpoint logic across versions.
- Automatically backport bug fixes and new features to older API versions by applying them to the newest version only.
- Evolve your API schema over time while keeping client code that depends on older versions working without modification.
- Learn or teach modern API versioning patterns by studying Cadwyn's migration-based approach and documentation.
- Build a multi-tenant SaaS where different customers are on different API versions but share the same backend code.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Cadwyn generates older API versions automatically from your newest implementation, letting you maintain backward compatibility through small, independent version-change modules rather than duplicating code across versions.
Yes, if you are building a FastAPI service that needs to support multiple API versions long-term. Cadwyn eliminates version duplication and keeps your business logic simple by handling backward compatibility through declarative version-change modules. It is actively maintained, has no known vulnerabilities, and carries a permissive MIT license. Install friction is low. The main consideration is learning the version-change module pattern, which the documentation covers.
Install
cadwyn on PyPI
pip
pip install cadwynuv
uv add cadwynpoetry
poetry add cadwynInstalling cadwyn
Before you install
Low friction install with a pure Python wheel. Actively maintained with a recent release (16 days old) and steady commits. Depends on FastAPI, Pydantic, and Starlette, which are standard in the ecosystem.
License in practice
MIT license is permissive—you can use, modify, and distribute this package freely in commercial and open-source projects with minimal restrictions.
Quickstart
pip install cadwyn
from cadwyn import Cadwyn
from fastapi import FastAPI
app = FastAPI()
cadwyn = Cadwyn(app=app)
Requires Python 3.10 or later and an existing FastAPI application to integrate with.
Verify before relying
- How much overhead does automatic version generation add to request/response handling at runtime?
- What is the learning curve for defining version-change modules, and are there patterns for complex schema migrations?
- How does Cadwyn handle breaking changes that cannot be automatically backported?
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 7 — backports-strenum, fastapi, jinja2, pydantic, starlette, typing-extensions, typing-inspection |
| Maintenance | actively maintained — 16 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 17,155,419/month — #1,130 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: cadwyn-7.2.0-py3-none-any.whl
Keywords: api, api-versioning, code-generation, fastapi, hints, json-schema, pydantic, python, python310, python311, python312, python313, python314, stripe, versioning
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
fastapi-slimThis package is a deprecated migration shim…
permissive · top 15,000 on PyPI
fastapi-cliFastAPI CLI is a command-line tool that runs…
permissive · top 1,000 on PyPI
fast-dependsFastDepends provides a standalone dependency…
permissive · top 5,000 on PyPI
fastapi-azure-authAdds Azure Entra ID (formerly Azure AD)…
permissive · top 15,000 on PyPI
fastapi-versioningAdds API versioning to FastAPI applications by…
permissive · top 15,000 on PyPI
langchain-classicProvides legacy LangChain chains, community…
permissive · top 1,000 on PyPI
dj-stripedj-stripe syncs Stripe payment objects into…
permissive · top 15,000 on PyPI
fastapi-eventsFastapi-events is an event dispatching and…
permissive · top 15,000 on PyPI
fastapi-lifespan-managerProvides a lifespan manager for FastAPI that…
permissive · top 15,000 on PyPI