zope.deprecation
Zope Deprecation Infrastructure
What it is and what it does
zope.deprecation is a small utility library for marking deprecated code paths in Python. It exports a `deprecated()` function that you apply as a decorator or call directly to flag modules, classes, functions, methods, and properties as no longer recommended. When deprecated code is accessed, the library emits a standard Python DeprecationWarning (or a custom warning class if you specify one), alerting users that they should migrate to a replacement.
The package is part of the Zope ecosystem and has been maintained since 2007. It supports modern Python versions (3.9–3.13) and runs on both CPython and PyPy. Installation is straightforward with only setuptools as a runtime dependency. The library is useful in any codebase where you need to signal API changes or removals over a deprecation period.
Use it for:
- Mark old API functions as deprecated to warn users before removing them in a major version.
- Signal that a module or class is being replaced, guiding users to the new implementation.
- Suppress deprecation warnings in specific code blocks using the Suppressor context manager.
- Customize warning classes to integrate deprecation signals with your project's warning infrastructure.
- Document API transitions in libraries that maintain backward compatibility across releases.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides a decorator and utilities to mark Python modules, classes, functions, methods, and properties as deprecated, emitting warnings when they are used.
Yes, if you maintain a library or large codebase and need a standard way to deprecate APIs. The package is lightweight, has no security vulnerabilities, and supports current Python versions. The aging maintenance status (336 days since release) is not a blocker for a stable utility like this, but verify that ZPL-2.1 licensing fits your project before adding it.
Install
zope-deprecation on PyPI
pip
pip install zope-deprecationuv
uv add zope-deprecationpoetry
poetry add zope-deprecationInstalling zope.deprecation
Before you install
Low friction install with a single runtime dependency (setuptools). Maintenance status is aging—last release was 336 days ago—but the repository remains active with recent commits and no archived status.
License in practice
Licensed under ZPL-2.1 (Zope Public License), classified as OSI-approved. License treatment is marked unclear in the fact sheet, so review the actual license terms before use in proprietary or restricted-license projects.
Quickstart
pip install zope.deprecation
from zope.deprecation import deprecated
@deprecated('old_function', 'Use new_function instead')
def old_function():
pass
Requires Python 3.9 or later; does not support Python 3.8 or earlier.
Verify before relying
- Whether the ZPL-2.1 license is compatible with your project's licensing requirements.
- Whether the aging maintenance status (336 days since last release) is acceptable for your use case.
Package facts
| License | ZPL-2.1 (unclear) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — setuptools |
| Maintenance | aging — 336 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,872,565/month — #2,849 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: zope_deprecation-6.0-py3-none-any.whl
Keywords: deprecation, deprecated, warning
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
zope.deferredimportDefers module imports until they are actually…
unclear · top 15,000 on PyPI
zope.dottednameConverts dotted name strings (like…
unclear · top 15,000 on PyPI
zope.exceptionsProvides general-purpose exception classes and…
unclear · top 15,000 on PyPI
deprecatProvides a Python decorator to mark functions,…
permissive · top 15,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
deprecation-aliasProvides a wrapper around the deprecation…
permissive · top 15,000 on PyPI
zExceptionszExceptions provides a collection of exception…
unclear · top 15,000 on PyPI
ExtensionClassProvides a metaclass that enables extension…
unclear · top 15,000 on PyPI
griffe-warnings-deprecatedExtends Griffe to recognize and render PEP 702…
permissive · top 15,000 on PyPI