pyDeprecate
Python deprecation decorator: call forwarding, argument mapping, class proxying, CI audit. Zero deps.
What it is and what it does
pyDeprecate is a decorator library that lets you keep old function and class names working while you migrate to new ones. When someone calls a deprecated function, the library automatically forwards the call to its replacement, emits a warning (once per function by default to avoid spam), and optionally remaps old argument names to new ones. It works with regular functions, async coroutines, generators, properties, classes, Enums, dataclasses, and module-level constants.
The package is built for API migration workflows: you rename a function, move a class, or retire an argument, but old user code must keep working during a transition window. pyDeprecate handles the forwarding transparently, preserves function signatures for introspection, and includes CI audit tools to enforce removal deadlines and detect deprecation chains that linger too long. It has zero runtime dependencies and supports Python 3.9 through 3.14.
Use it for:
- Rename a function across your codebase while keeping the old name working for external callers during a grace period.
- Move a class to a new module and expose it at the old location with a deprecation warning.
- Change function argument names and automatically remap old call sites to the new names.
- Deprecate an entire class or Enum with a transparent proxy that warns on access.
- Enforce in CI that deprecated APIs are removed by their deadline using audit metadata helpers.
- Wrap constants or singleton objects as read-only deprecated instances to prevent accidental mutation.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Deprecate Python functions, methods, classes, and constants with transparent call forwarding, argument remapping, and CI audit support—all with zero runtime dependencies.
Yes. pyDeprecate is actively maintained, has zero dependencies, supports modern Python versions, and solves a real problem in API evolution. Use it when you need to rename or move code without breaking existing callers. The audit tools make it practical to enforce removal deadlines in CI. No security issues reported.
Install
pydeprecate on PyPI
pip
pip install pydeprecateuv
uv add pydeprecatepoetry
poetry add pydeprecateInstalling pyDeprecate
Before you install
Installs cleanly with no runtime dependencies. Active maintenance: last commit 2026-08-13, released 2026-07-17 (28 days ago). Supports Python 3.9 through 3.14.
License in practice
Apache-2.0 (permissive): you can use, modify, and distribute this package freely in commercial and open-source projects with minimal restrictions.
Quickstart
pip install pyDeprecate
from deprecate import deprecated
def new_func(x: int) -> int:
return x * 2
@deprecated(target=new_func, deprecated_in="1.0", remove_in="2.0")
def old_func(x: int) -> int:
pass
result = old_func(5)
Requires Python 3.9 or later.
Verify before relying
- Performance overhead of the deprecation wrapper at scale in tight loops or high-frequency call sites.
- Interaction with type checkers (mypy, pyright) when using deprecated decorators on overloaded functions.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 28 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 911,644/month — #4,744 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pydeprecate-0.11.0-py3-none-any.whl
Keywords: deprecation, decorator, API migration, call forwarding, argument renaming, backwards compatibility, CI audit
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
deprecatProvides a Python decorator to mark functions,…
permissive · top 15,000 on PyPI
legacy-api-wrapProvides a decorator to wrap legacy function…
copyleft · top 5,000 on PyPI
DeprecatedProvides a @deprecated decorator to mark…
permissive · top 1,000 on PyPI
deprecationProvides decorators to automate deprecation…
permissive · top 1,000 on PyPI
zope.deprecationProvides a decorator and utilities to mark…
unclear · top 5,000 on PyPI
griffe-warnings-deprecatedExtends Griffe to recognize and render PEP 702…
permissive · top 15,000 on PyPI
django-deprecate-fieldsProvides a decorator to mark Django model…
permissive · top 5,000 on PyPI
flake8-deprecatedA flake8 plugin that detects calls to…
copyleft · top 15,000 on PyPI
debtcollectorDebtcollector provides Python deprecation…
permissive · top 5,000 on PyPI
apify-sharedApify Shared Python is a deprecated package…
permissive · top 5,000 on PyPI