Metadata-Version: 2.1
Name: strip-deco
Version: 0.0.2
Summary: Easily strip decorator from function or class method
Home-page: https://github.com/teamhide/strip-deco
Author: Hide
Author-email: padocon@naver.com
License: UNKNOWN
Description: # strip-deco
        [![license]](/LICENSE)
        [![pypi]](https://pypi.org/project/strip-deco/)
        [![pyversions]](http://pypi.python.org/pypi/strip-deco)
        ![badge](https://action-badges.now.sh/teamhide/strip-deco)
        [![Downloads](https://pepy.tech/badge/strip-deco)](https://pepy.tech/project/strip-deco)
        
        ---
        
        **strip-deco** easily strip decorator from function or class method
        
        ## Installation
        
        ```python
        pip3 install strip-deco
        ```
        
        ## Example of function decorator
        ```python
        from strip_deco import stripdeco
        
        
        def deco(func):
            def _deco(*args, **kwargs):
                result = func(*args, **kwargs)
                return result
            return _deco
            
        @deco
        def test():
            pass
            
        
        original_func = stripdeco(obj=test)
        
        
        @deco
        @deco
        @deco
        def test():
            pass
            
        
        original_func = stripdeco(obj=test, depth=2)  # It will only strip two decorator
        ```
        
        ## Example of Class decorator
        ```python
        from strip_deco import stripdeco
        
        
        class Deco:
            def __call__(self, func):
                def deco(*args, **kwargs):
                    return func(*args, **kwargs)
                return deco
               
         
        @Deco()
        def test():
            pass
            
            
        original_func = stripdeco(obj=test)
        
        
        @Deco()
        @Deco()
        @Deco()
        def test():
            pass
        
        
        original_func = stripdeco(obj=test, depth=2)  # It will only strip two decorator
        ```
        
        ## Example of class method
        ```python
        from strip_deco import stripdeco
        
        
        def deco(func):
            def _deco(*args, **kwargs):
                result = func(*args, **kwargs)
                return result
            return _deco
        
        
        class Service:
            @deco
            def run(self):
                pass
            
            @deco
            def run_with_arguments(self, user_id):
                pass
        
        
                
                
        original_func = stripdeco(obj=Service().run)
        original_func(Service)  # Must add class through first argument
        
        original_func = stripdeco(obj=Service().run_with_arguments)
        original_func(Service, user_id=1)  # Case of other arguments
        ```
        
        ## Note
        
        - strip-deco automatically removes  any kind of decorators. (class/function)
        - It supports both decorator,`functools wraps` and non functools wraps .
        - If you specify depth paramater, it will strip order by outside.
        - The class argument is required when executing class method.
        
        
        [license]: https://img.shields.io/badge/License-GPLv3-blue.svg
        [pypi]: https://img.shields.io/pypi/v/strip-deco
        [pyversions]: https://img.shields.io/pypi/pyversions/strip-deco
Platform: UNKNOWN
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.4
Description-Content-Type: text/markdown
