{"categories":[{"label":"Application Frameworks","url":"https://skillfed.io/packages/category/software-development-libraries-application-frameworks/3"}],"enrichment":{"capability":"Swapper provides an API for Django's undocumented swappable models feature, allowing library authors to make their app's models replaceable by end users without requiring abstract base classes or concrete model constraints.","skillfed_tags":["django-extension","model-customization","library-authoring"],"use_cases":["Building a reusable Django package where users need to extend or replace core models with custom fields or logic.","Implementing multi-tenant or white-label SaaS applications where each tenant's model structure must be customizable.","Creating extensible authentication or user management libraries that don't force a single User model design.","Handling migration dependencies correctly when your library has multiple levels of related swappable models.","Allowing end users to swap models without requiring them to fork or patch your library code."],"what_it_does":"Swapper is a library that wraps Django's built-in but undocumented swappable models mechanism\u2014the same system Django uses internally for auth.User\u2014and exposes it as a stable API for third-party library authors. It lets you design reusable Django apps whose core models can be replaced entirely by end users, without forcing you to use abstract base classes or accept concrete models that cannot be customized.\n\nThe library provides functions to declare which models are swappable, load the correct model class at runtime (whether default or user-provided), and handle foreign keys and migrations correctly. This is primarily a tool for library authors; end users of your app typically configure a single setting to swap models, similar to how they would set AUTH_USER_MODEL.","worth_installing":"Yes. Swapper is production-stable (Development Status 5), actively maintained, has no external dependencies, and solves a real problem for library authors building customizable Django apps. The MIT license imposes no restrictions. Install it if you are authoring a reusable Django package that needs model extensibility; skip it if you are building a single application."},"id":"swapper","links":{"html":"https://skillfed.io/packages/swapper","md":"https://skillfed.io/packages/swapper.md","pypi":"https://pypi.org/project/swapper/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2024-08-14","license_spdx":null,"license_treatment":"permissive","name":"swapper","python_support":"unspecified","summary":"The unofficial Django swappable models API."},"popularity":{"monthly_downloads":522809,"position":6200,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"1.4.0"}
