skillfed

cadwyn

Production-ready community-driven modern Stripe-like API versioning in FastAPI

cadwyn v7.2.0 17.2M downloads/30d#1,130 on PyPI307
Permissive license MIT Active released

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 cadwyn

uv

uv add cadwyn

poetry

poetry add cadwyn

Installing 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

Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentFramework :: AsyncIOFramework :: FastAPIFramework :: PydanticIntended Audience :: DevelopersIntended Audience :: Information TechnologyIntended Audience :: System AdministratorsLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: InternetTopic :: Internet :: WWW/HTTPTopic :: Internet :: WWW/HTTP :: HTTP ServersTopic :: Software DevelopmentTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Application FrameworksTopic :: Software Development :: Libraries :: Python ModulesTyping :: Typed

Tags

api versioning fastapistripe-like api versioningautomatic api version generationfastapi backward compatibilityapi migration versioningversion change modulesmulti-version api support
api-versioningfastapi-extensionbackward-compatibility

More Software Development packages