--- id: decopatch version: "1.4.10" license: BSD 3-Clause license_treatment: permissive maintenance: dormant --- # decopatch — Create decorators easily in python. License: permissive · Maintenance: dormant · Downloads: 1.7M/mo ## What it is and what it does Decopatch is a library that removes the friction from writing Python decorators. Creating decorators typically requires careful handling of function signatures, argument passing, and wrapper metadata—tasks that are repetitive and error-prone. Decopatch provides utilities to generate decorators with minimal boilerplate, automatically preserving the decorated function's signature and handling both parameterized and non-parameterized decorator syntax. The package depends on makefun (for signature generation), funcsigs, and enum34 (compatibility backports). It is marked Production/Stable and supports Python 2.7 through 3.9. The codebase is dormant but stable, with no known security vulnerabilities, making it a low-risk choice for projects that need straightforward decorator creation without active maintenance demands. Use it for: - Writing a logging decorator that wraps functions while preserving their original signatures and metadata. - Creating a retry decorator that can be used with or without arguments (@retry or @retry(max_attempts=3)). - Building a validation decorator that inspects function arguments before execution. - Generating timing or profiling decorators that measure function execution without altering the wrapped function's interface. - Implementing authorization or access-control decorators for web frameworks or APIs. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Decopatch simplifies writing decorators in Python by handling the boilerplate of preserving function signatures and managing decorator arguments, letting you focus on the decorator logic itself. Yes, if you write decorators regularly and want to reduce boilerplate. The package is stable, carries no vulnerabilities, and has low install friction. However, be aware that maintenance is dormant—if you need active support or encounter edge cases, you may need to fork or maintain patches yourself. For standard decorator patterns on modern Python, consider whether the built-in functools.wraps and decorator patterns meet your needs first. ## Install pip install decopatch uv add decopatch poetry add decopatch ## Installing decopatch Before you install: Low install friction with a pure-Python wheel. Maintenance is dormant—last release was in 2022 and the last commit in 2024—but the package is marked Production/Stable and carries no known vulnerabilities, so it is suitable for stable decorator patterns that do not require active development. License in practice: BSD 3-Clause is permissive, allowing commercial and private use with minimal restrictions. You must include a copy of the license and retain copyright notices, but there are no copyleft obligations. Quickstart: pip install decopatch from decopatch import decorator @decorator def my_decorator(func, *args, **kwargs): return func(*args, **kwargs) @my_decorator def my_function(): pass Verify before relying: - Whether enum34 and funcsigs are truly needed on modern Python versions (they are typically backports for Python 2.7 and early Python 3). - Specific decorator patterns or edge cases the package handles beyond standard function wrapping. ## Package facts - License: BSD 3-Clause (permissive) - Python support: unspecified - Install friction: low - Maintenance: dormant - Downloads: 1.7M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags python decorator creation, decorator with arguments, preserve function signature, decorator boilerplate, easy decorator library, function wrapping utilities, decorator generator, decorator-utilities, python-2-compatible [View on SkillFed](https://skillfed.io/packages/decopatch) · [View on PyPI](https://pypi.org/project/decopatch/)