--- id: deprecat version: "2.1.3" license: MIT license_treatment: permissive maintenance: dormant --- # deprecat — Python @deprecat decorator to deprecate old python classes, functions or methods. License: permissive · Maintenance: dormant · Downloads: 350.8K/mo ## What it is and what it does deprecat is a lightweight decorator library for marking Python functions, methods, and classes as deprecated. When a user calls a deprecated target, the decorator emits a standard DeprecationWarning with a custom reason and version number, helping library maintainers signal API changes without breaking existing code. The package includes a Sphinx integration that automatically injects deprecation notices into docstrings, making the deprecation visible in generated documentation. It supports deprecating individual keyword arguments as well, allowing fine-grained control over which parts of an API are being phased out. The single runtime dependency is wrapt, and installation is straightforward. Use it for: - Signal to users that a function or method will be removed in a future version, with a custom reason and target version. - Automatically inject deprecation warnings into Sphinx-generated API documentation without manual docstring edits. - Deprecate specific keyword arguments in a function while keeping the function itself active. - Emit warnings when a class is instantiated to guide users toward a replacement class. - Track and communicate API changes across library versions in a standardized, Python-native way. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides a Python decorator to mark functions, methods, and classes as deprecated, emitting warnings to users and optionally modifying docstrings for Sphinx documentation. Yes, if you are maintaining a library and need a simple, zero-configuration way to emit deprecation warnings. The package is stable, has no vulnerabilities, and requires only one lightweight dependency. Maintenance is dormant, but the decorator pattern itself is stable and unlikely to need updates. Not recommended if you need active support or expect frequent maintenance. ## Install pip install deprecat uv add deprecat poetry add deprecat ## Installing deprecat Before you install: Low install friction with a single runtime dependency (wrapt). Maintenance is dormant—last commit 2024-07-24—but marked Production/Stable with no known vulnerabilities, so usable for straightforward deprecation tasks. License in practice: MIT license (permissive) means you can use, modify, and distribute this package freely in commercial or open-source projects with minimal restrictions. Quickstart: pip install deprecat from deprecat import deprecat @deprecat(reason="use new_function instead", version='2.0') def old_function(x): return x * 2 old_function(5) # Emits DeprecationWarning Requires Python >=3.6; wrapt must be installed (handled automatically by pip). Verify before relying: - Whether the package handles all edge cases in Python 3.10 and 3.9 given dormant maintenance status. - Performance impact of the wrapt dependency in high-throughput code paths. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: dormant - Downloads: 350.8K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags deprecation decorator python, mark function deprecated, deprecation warning, python deprecate decorator, class method deprecation, sphinx deprecation, deprecation management, api-lifecycle, documentation-integration [View on SkillFed](https://skillfed.io/packages/deprecat) · [View on PyPI](https://pypi.org/project/deprecat/)