wrapt
Module for decorators, wrappers and monkey patching.
Install
wrapt on PyPI
pip
pip install wraptuv
uv add wraptpoetry
poetry add wraptPackage facts
| License | BSD-2-Clause (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 16 days since the last release |
| Last repo commit | |
| First released | |
| Popularity | one of the 100 most-downloaded packages on PyPI (30-day window, as of 2026-08-13) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-13) |
Evidence: wrapt-2.3.0-py3-none-any.whl
Keywords: wrapper, proxy, decorator
About wrapt
from the package's own PyPI description — quoted content, verbatim
wrapt
|PyPI| |Documentation|
A Python module for decorators, wrappers and monkey patching.
Overview
The wrapt module provides a transparent object proxy for Python, which can be used as the basis for the construction of function wrappers and decorator functions.
The wrapt module focuses very much on correctness. It goes way beyond existing mechanisms such as functools.wraps() to ensure that decorators preserve introspectability, signatures, type checking abilities etc. The decorators that can be constructed using this module will work in far more scenarios than typical decorators and provide more predictable and consistent behaviour.
To ensure that the overhead is as minimal as possible, a C extension module is used for performance critical components. An automatic fallback to a pure Python implementation is also provided where a target system does not have a compiler to allow the C extension to be compiled.
Key Features
- Universal decorators that work with functions, methods, classmethods, staticmethods, and classes
- Transparent object proxies for advanced wrapping scenarios
- Monkey patching utilities for safe...
Read as markdown · JSON record · Source repository · Homepage · Docs
AI interpretation — verify before relying
AI-generated interpretation of the package facts above; every digit, version, license, or vulnerability id it cites is grounded in the facts already shown on this page
wrapt provides a transparent object proxy and decorator framework that preserves function signatures, introspection, and type information across functions, methods, classmethods, staticmethods, and classes, with optional C acceleration.
Installs cleanly with low friction; pure Python wheel available with C extension fallback. Active maintenance—last release 16 days ago, continuous Python 3.9+ support.
BSD-2-Clause permissive license allows commercial and private use with minimal restrictions; suitable for most projects.
Usage
pip install wrapt
import wrapt
@wrapt.decorator
def my_decorator(wrapped, instance, args, kwargs):
return wrapped(*args, **kwargs)
@my_decorator
def my_function():
pass
Requires Python 3.9 or later; C compiler optional (pure Python fallback available).
Verdict: wrapt is a mature, actively maintained decorator library in the top 100 PyPI packages with zero known vulnerabilities. It solves real problems with Python's standard decorator mechanisms—preserving signatures and introspection—and offers both C and pure-Python implementations. Permissive BSD-2-Clause license and low install friction make it a safe, production-ready choice.
Needs verification
- Whether the C extension provides measurable performance gains for typical decorator workloads compared to the pure Python fallback.
- Compatibility guarantees or known issues with PyPy beyond the stated support in classifiers.
- Real-world adoption metrics beyond the GitHub star count of 2294.
Similar packages
permissive · top 1,000 on PyPI
decoratorpermissive · top 1,000 on PyPI
aiofilespermissive · top 1,000 on PyPI
lazy-object-proxypermissive · top 1,000 on PyPI
fastcorepermissive · top 1,000 on PyPI
exceptiongrouppermissive · top 1,000 on PyPI
argcompletepermissive · top 1,000 on PyPI
tblibpermissive · top 1,000 on PyPI
azure-coreunclear · top 1,000 on PyPI
retryingpermissive · top 1,000 on PyPI