extdbg
Extended debugging python utilities
Installation:
Install from PyPI:
pip install extdbg
Or using alternative command:
pip install https://github.com/duboviy/extdbg/archive/master.zip
Or from source use:
python setup.py install
Supported python versions
- 2.7
- 3.3
- 3.4
- 3.5
- PyPy
PyPI
Contents
from extdbg import ... (see variants in list below)
init_except_hook
- initialise extended traceback hook with locals variables in exception messageadd_watched_attribute(name, watch_get=False)
- when called in class (for exampleadd_watched_attribute('name')
) - instances of that class will log every change to the attribute. And log every access ifwatch_get
isTrue
.where_is(object)
- return location of object in code.from_where_called()
- returns location in code from where function which calles this is calledthreaded
- allows you to decorate a function in your Python code, making it run in a separate threadlog_get_func_calls
- return all function calls from a python filepublic and internal
- additional context decorators (like public and private in other languages)hackable_properties
- properties mock setter. Use this module to mock/stub any property of New Style Classwatch_for_output(condition=lambda x: True, stream='stdout')
- log location in code where some output is performedpprint
- pprint values wrapped into frame. Also return first passed value unchanged (useful when debugging expressions)func_to_dict
- converts function of one hashable argument to dictionary-like object which "contains" all it returning valuesboundFunc
- bind any function/lambda as instance's methodsave_object and load_object
- pickle objects in/from filesenable_debug
- use on remote process to debug it using pycharm remote server run
... and many other features
License
MIT licensed library. See LICENSE.txt for details.
Contributing
If you have suggestions for improving the extdbg, please open an issue or pull request on GitHub.