--- id: deprecated version: "1.3.1" license: MIT license_treatment: permissive maintenance: active --- # Deprecated — Python @deprecated decorator to deprecate old python classes, functions or methods. License: permissive · Maintenance: active · Popularity: top 1,000 on PyPI ## Install pip install deprecated uv add deprecated poetry add deprecated ## Description Deprecated Library ------------------ Deprecated is Easy to Use ````````````````````````` If you need to mark a function or a method as deprecated, you can use the ``@deprecated`` decorator: Save in a hello.py: .. code:: python from deprecated import deprecated @deprecated(version='1.2.1', reason="You should use another function") def some_old_function(x, y): return x + y class SomeClass(object): @deprecated(version='1.3.0', reason="This method is deprecated") def some_old_method(self, x, y): return x + y some_old_function(12, 34) obj = SomeClass() obj.some_old_method(5, 8) And Easy to Setup ````````````````` And run it: .. code:: bash $ pip install Deprecated $ python hello.py hello.py:15: DeprecationWarning: Call to deprecated function (or staticmethod) some_old_function. (You should use another function) -- Deprecated since version 1.2.0. some_old_function(12, 34) hello.py:17: DeprecationWarning: Call to deprecated method some_old_method. (This method is deprecated) -- Deprecated since version 1.3.0. obj.some_old_method(5, 8) You can document your... ## AI interpretation — verify before relying Provides a @deprecated decorator to mark functions, methods, and classes as deprecated, emitting DeprecationWarning when called and optionally generating Sphinx documentation directives. Verdict: Stable, well-maintained library with no known vulnerabilities and permissive MIT licensing. Minimal dependencies and broad Python version support (2.7 through 3.14) make it a low-risk choice for adding deprecation markers to existing codebases. [View on SkillFed](https://skillfed.io/packages/deprecated) · [View on PyPI](https://pypi.org/project/deprecated/)