deprecat
Python @deprecat decorator to deprecate old python classes, functions or methods.
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 on this page — 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
deprecat on PyPI
pip
pip install deprecatuv
uv add deprecatpoetry
poetry add deprecatInstalling 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 the current Python release (>=3.6) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — wrapt |
| Maintenance | dormant — 751 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 350,821/month — #7,327 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: deprecat-2.1.3-py2.py3-none-any.whl
Keywords: deprecate, deprecated, deprecation, warning, warn, decorator
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 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
legacy-api-wrapProvides a decorator to wrap legacy function…
copyleft · top 5,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
debtcollectorDebtcollector provides Python deprecation…
permissive · top 5,000 on PyPI
deprecation-aliasProvides a wrapper around the deprecation…
permissive · top 15,000 on PyPI
django-deprecate-fieldsProvides a decorator to mark Django model…
permissive · top 5,000 on PyPI
publicProvides a decorator-based alternative to…
permissive · top 15,000 on PyPI
apify-sharedApify Shared Python is a deprecated package…
permissive · top 5,000 on PyPI