skillfed

pyDeprecate

Python deprecation decorator: call forwarding, argument mapping, class proxying, CI audit. Zero deps.

pydeprecate v0.11.0 911.6K downloads/30d#4,744 on PyPI61
Permissive license Apache-2.0 Active released

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 pydeprecate

uv

uv add pydeprecate

poetry

poetry add pydeprecate

Installing 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

Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: DevelopersNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Topic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python ModulesTopic :: Software Development :: Quality Assurance

Tags

deprecation decorator pythonfunction call forwardingargument renaming backwards compatibilityapi migration tooldeprecation audit ciclass proxy deprecationwarning forwarding decorator
api-migrationbackwards-compatibilityci-audit

More Libraries packages