wrapt
Module for decorators, wrappers and monkey patching.
Decision gist · record as of 2026-08-14
Yes. wrapt is a foundational library with active maintenance, no known vulnerabilities, low install friction, and permissive licensing. It is essential for anyone building decorators that must work reliably across all callable types and preserve introspection—a common requirement in frameworks, instrumentation, and testing tools.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.9 or later; a C compiler is optional (pure Python fallback available).
- Low friction installation with a pure-Python fallback; the package is actively maintained with a recent release and no known vulnerabilities.
License · maintenance · safety
BSD-2-Clause (permissive) — BSD-2-Clause is permissive and poses no restrictions on commercial or proprietary use.
last release 2026-07-28 (17 days) · last repo commit 2026-08-13 · 2,294 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 495,611,441 downloads/mo, #81 on PyPI
Alternatives
Verify before relying
pip install wrapt
import wrapt
@wrapt.decorator
def my_decorator(wrapped, instance, args, kwargs):
return wrapped(*args, **kwargs)
@my_decorator
def my_function():
passWhat it is and what it does
wrapt is a mature decorator and object-proxy library that solves the problem of building decorators that work correctly across all Python callable types—functions, methods, classmethods, staticmethods, and classes—while preserving their signatures, annotations, and introspection capabilities. Unlike the standard library's functools.wraps, wrapt ensures that decorated callables behave predictably in edge cases and maintain their original metadata for tools like type checkers and documentation generators.
The package uses a C extension for performance-critical paths but falls back to pure Python when compilation is not available, making it portable across systems. It is commonly used as a foundation for building robust decorators in libraries and frameworks that need to wrap or intercept function calls without breaking introspection or type information.
Use it for
- Building universal decorators that work identically on functions, instance methods, classmethods, and staticmethods without special-case code.
- Creating instrumentation or monitoring decorators that preserve the wrapped function's signature for debugging and profiling tools.
- Implementing transparent object proxies for lazy loading, caching, or access control without breaking isinstance checks or attribute access.
- Monkey-patching library functions at runtime while maintaining correct behavior for introspection and type checking.
- Wrapping async functions and coroutines while preserving their awaitable nature and metadata.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
wrapt is a foundational library with active maintenance, no known vulnerabilities, low install friction, and permissive licensing. It is essential for anyone building decorators that must work reliably across all callable types and preserve introspection—a common requirement in frameworks, instrumentation, and testing tools.
Install
wrapt on PyPI
Before you install
Low friction installation with a pure-Python fallback; the package is actively maintained with a recent release and no known vulnerabilities.
Requires Python 3.9 or later; a C compiler is optional (pure Python fallback available).
License in practice
BSD-2-Clause is permissive and poses no restrictions on commercial or proprietary use.
Quickstart
pip install wrapt
import wrapt
@wrapt.decorator
def my_decorator(wrapped, instance, args, kwargs):
return wrapped(*args, **kwargs)
@my_decorator
def my_function():
pass
Package 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 17 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 495,611,441 / month, #81 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPy |
Evidence: wrapt-2.3.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “universal decorator framework”
- wraptwrapt provides a Python module for building decorators, object…
- udapiUdapi is a Python framework for reading, processing, and manipulating…
- udtoolsValidates CoNLL-U format files against Universal Dependencies…
Give your agent the search over MCP, or paste the wish link into any chat.
Similar packages
Autowrapt enables monkey patching of Python applications via setuptools entrypoints and environment variables, without modifying the application code itself.
Provides a decorator that enforces singleton pattern on classes while preserving direct access to the underlying class for unit testing via the `__wrapped__` attribute.
A drop-in replacement for `functools.wraps` that preserves static type information when wrapping functions, so type checkers see the wrapped function's actual signature instead of `*args, **kwargs`.
Strips decorators from Python functions, methods, or classes to access the original undecorated implementation.
However, verify it works on your Python version (last tested on 3.6) and consider forking if you need future maintenance.
A collection of internal testing utilities, async helpers, and operational tools including caching decorators, API URL builders, lazy-initialization metaclasses, Unix shell wrappers, JSON logging, metrics servers, and backup integrations.
Sigtools provides utilities to inspect and manipulate Python function signatures, including resolving signatures through decorators and creating introspectable wrappers that preserve signature information.
However, it is abandoned—no maintenance since October 2022.
See also botoinator · decopatch · decorator · makefun