Package decorit
decorit
The documentation including examples can be found here.
This is a package with handy ready-to-use decorators for daily scripting and maintaining packages. Decorator requests are highly appreciated, simply open an issue.
If you want to learn how to write your own decorators I recommand to head over to realpython and check out this article. In case you are looking for an wrapper to easily write decorators for your own, you might checkout pydecor.
This project is in an alpha stage, hence it is neither stable nor ready for production.
CAUTION: Starting from version 1.0.0 API-breaking changes will be made only in major releases. Until then, it can be changed in every minor release (see changelog).
Features
Existing decorators:
- copy_doc
: copy docstring of existing function
- copy_doc_params
: copy parameters of docstring of existing function
- deprecated
: print deprecated warning on call
- alias
: give multiple names to function, e.g. short and long
- logging
: logging call of functions
- time
: timeing execution of function
- run_once
: run function only once at first call
Usage
Installation
# via PyPI
python3 -m pip install decorit
# or conda
conda install decorit
Usage
import decorit
# start decorating your functions
Building Documentation:
The doc is based on pdoc and can be created by
simply running bash create_doc.sh
from the docs folder. For dependencies see in the
CI action.
Similar Projects
Credits:
In alphabetical order: - realpython
Expand source code
"""
.. include:: ../../README.md
"""
from .decorit import (
alias,
copy_doc,
copy_doc_params,
deprecated,
logging,
time,
run_once,
)
__version__ = '0.2.0'
Sub-modules
decorit.decorit
-
Definition of decorators …