The following features a class implementation for a function decorator in Python with an arbitrary number of optional keywords arguments.
Implementing the decorator as a class, has the advantage of encapsulation and ease of reuse.
Note that this code uses the python package wrapt, which can easily be installed using pip.