decorator
Decorators for Humans
Install
decorator on PyPI
pip
pip install decoratoruv
uv add decoratorpoetry
poetry add decoratorPackage facts
| License | BSD-2-Clause (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 87 days since the last release |
| First released | |
| Popularity | one of the top 1,000 most-downloaded packages on PyPI (30-day window, as of 2026-08-13) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-13) |
Evidence: decorator-5.3.1-py3-none-any.whl
Keywords: decorators
About decorator
from the package's own PyPI description — quoted content, verbatim
Decorators for Humans
The goal of the decorator module is to make it easy to define signature-preserving function decorators and decorator factories. It also includes an implementation of multiple dispatch and other niceties (please check the docs). It is released under a two-clauses BSD license, i.e. basically you can do whatever you want with it but I am not responsible.
Installation
If you are lazy, just perform
$ pip install decorator
which will install just the module on your system.
If you prefer to install the full distribution from source, including
the documentation, clone the GitHub repo or download the tarball, unpack it and run
$ pip install .
in the main directory, possibly as superuser.
.. _tarball: https://pypi.org/project/decorator/#files .. _GitHub repo: https://github.com/micheles/decorator
Testing
If you have the source code installation you can run the tests with
$ python tests/test.py -v
Notice that you may run into trouble if in your system there
is an older version of the decorator module; in such a case remove the
old version. It is safe even to copy the module decorator.py...
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
Provides utilities for writing signature-preserving function decorators and decorator factories, including multiple dispatch support, without boilerplate.
Installs cleanly with no runtime dependencies and a pure-Python wheel. Actively maintained with a release 87 days ago; supports Python 3.8–3.14.
Released under BSD-2-Clause (permissive), allowing commercial and private use with minimal restrictions—attribution and liability disclaimer required.
Usage
pip install decorator
from decorator import decorator
import time
@decorator
def timing_wrapper(func, *args, **kw):
t0 = time.time()
result = func(*args, **kw)
print(f'{func.__name__} took {time.time() - t0:.2f}s')
return result
@timing_wrapper
def my_function():
pass
Verdict: A mature, well-maintained library (Production/Stable, active, zero known vulnerabilities) that solves a real pain point in Python decorator writing. Low install friction, permissive license, and broad Python version support make it a safe, practical choice for projects needing cleaner decorator syntax.
Needs verification
- Whether multiple dispatch implementation is feature-complete relative to dedicated dispatch libraries.
- Performance characteristics compared to hand-written decorators or alternative decorator utilities.
Similar packages
permissive · top 100 on PyPI
backoffpermissive · top 1,000 on PyPI
cataloguepermissive · top 1,000 on PyPI
logurupermissive · top 1,000 on PyPI
jaraco.contextpermissive · top 1,000 on PyPI
tblibpermissive · top 1,000 on PyPI
slowapipermissive · top 1,000 on PyPI
cachetoolspermissive · top 1,000 on PyPI
argcompletepermissive · top 1,000 on PyPI
jaraco.functoolspermissive · top 1,000 on PyPI