Metadata-Version: 2.1
Name: intercepts
Version: 0.1.1
Summary: Intercept function and method calls
Home-page: https://github.com/dlshriver/intercepts
Author: David Shriver
Author-email: davidshriver@outlook.com
License: UNKNOWN
Project-URL: Source, https://github.com/dlshriver/intercepts/
Project-URL: Issues, https://github.com/dlshriver/intercepts/issues
Description: Intercepts
        ==========
        
        Intercepts allows you to intercept any function call in `python` and handle it in any manner you choose. For example, you can pre-process the inputs to a function, or apply post-processing on its output. Intercepts also allows you to completely replace a function with a custom implementation.
        
        ```python
        >>> increment(41)
        42
        >>> intercepts.register(increment, handler)
        >>> increment(41)
        40
        >>> intercepts.unregister(increment)
        >>> intercepts.register(increment, handler2)
        >>> increment(41)
        'The answer is: 42'
        >>> intercepts.unregister_all()
        ```
        
        Handler functions receive the intercepted function as their first argument, as well as all of the arguments to the intercepted function.
        
        ```python
        >>> def handler(func, num):
        ...  result = func(num)
        ...  return num - (result - num)
        >>> def handler2(func, *args, **kwargs):
        ...  return 'The answer is: %s' % func(*args, **kwargs)
        ```
        
        Installation
        ------------
        
        Intercepts can be installed using `pip`.
        
            $ pip install intercepts
        
        Documentation
        -------------
        
        Sorry, we are in the very early stages of development so documentation is limited. There is some documentation in the [`docs`](https://github.com/dlshriver/intercepts/tree/master/docs) directory, but for the most up-to-date documentation, use `pydoc`.
        
            $ pydoc intercepts
        
        ***This software is in early stages of development and may be unstable.***
        
Keywords: intercepts testing development
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Testing
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Description-Content-Type: text/markdown
