legacy-api-wrap (version 1.5) provides a decorator for Python functions to seamlessly bridge old and new API interfaces. It allows developers to deprecate old argument names while still supporting them, typically by emitting warnings when old names are used. The library is actively maintained with feature-driven releases, ensuring compatibility and developer-friendly transitions.
pip install legacy-api-wrapVerified import paths — ran on the pinned version, not inferred.
This example demonstrates defining a function with a new API signature and wrapping it with `legacy_api_wrap` to allow calls using old argument names. It also shows how the decorator emits `FutureWarning`s when old arguments are used.
Be aware of `FutureWarning`s emitted during migration. To change their behavior, use `warnings.filterwarnings()` or pass a custom `warning_category` to the decorator, e.g., `@legacy_api_wrap(..., warning_category=DeprecationWarning)`.
Thoroughly test the wrapped function with old API calls, ensuring all expected arguments are mapped within the `@legacy_api_wrap(...)` decorator configuration.
Document this behavior for users of the wrapped function and ensure migration guides clarify that only new argument names should be used once fully migrated. Avoid passing both old and new names simultaneously.
No dependency data recorded yet.