Package: clevdebug
OverviewThis package is created to make the debug process much easier for python projects.AlgorithmThis package imports@debugdecorator for functions and methods, which:Prints all arguments taken by function and their types.Show how long is instance running in seconds.Catches and prints out detailed information about all exceptions.Prints out all returned values and their types.UsageImport debug from clevdebug library:from clevdebug import debugAdd@debugdecorator to the function or method:@debugRun the script.ExamplesThere are several usage cases.Simple Example# import debug from clevdebugfromclevdebugimportdebug# Debugger for function@debugdeffoob(a,b):returnb# Debugger for method in classclassBoof:@debugdef__init__(a,b)->None:passif__name__=='__main__':boo=Boof(1,b=2)foob(1,2)Output is:2022-10-29 19:27:49,521 debugger of foo                        wrapper on line         20: ========================================
2022-10-29 19:27:49,521 debugger of foo                        wrapper on line         21: Calling [<class 'function'>]foo:
2022-10-29 19:27:49,521 debugger of foo                        wrapper on line         37: There are 2 arguments:
2022-10-29 19:27:49,521 debugger of foo                        wrapper on line         40:      a: [<class 'int'>] 5
2022-10-29 19:27:49,521 debugger of foo                        wrapper on line         40:      b: [<class 'int'>] 4
2022-10-29 19:27:49,521 debugger of foo                        wrapper on line         43: Running foo takes: 0.00000
2022-10-29 19:27:49,521 debugger of foo                        wrapper on line         45: Result is: [<class 'int'>]4
2022-10-29 19:27:49,521 debugger of foo                        wrapper on line         58: ========================================
2022-10-29 19:27:49,521 debugger of __init__                        wrapper on line         20: ========================================
2022-10-29 19:27:49,521 debugger of __init__                        wrapper on line         21: Calling [<class 'function'>]__init__:
2022-10-29 19:27:49,521 debugger of __init__                        wrapper on line         37: There are 2 arguments:
2022-10-29 19:27:49,521 debugger of __init__                        wrapper on line         40:         a: [<class 'int'>] 5
2022-10-29 19:27:49,521 debugger of __init__                        wrapper on line         40:         b: [<class 'int'>] 4
2022-10-29 19:27:49,521 debugger of __init__                        wrapper on line         43: Running __init__ takes: 0.00000
2022-10-29 19:27:49,521 debugger of __init__                        wrapper on line         47: There is no return.
2022-10-29 19:27:49,521 debugger of __init__                        wrapper on line         58: ========================================Catching errors# import debug from clevdebugfromclevdebugimportdebug# Debugger for function@debugdeffoob(a,b):returnb/0if__name__=='__main__':foob(1,2)Output is:2022-10-29 19:37:47,173 debugger of foob                        wrapper on line         20: ========================================
2022-10-29 19:37:47,173 debugger of foob                        wrapper on line         21: Calling [<class 'function'>]foob:
2022-10-29 19:37:47,173 debugger of foob                        wrapper on line         37: There are 2 arguments:
2022-10-29 19:37:47,173 debugger of foob                        wrapper on line         40:     a: [<class 'int'>] 1
2022-10-29 19:37:47,173 debugger of foob                        wrapper on line         40:     b: [<class 'int'>] 2
2022-10-29 19:37:47,174 debugger of foob                        wrapper on line         54: Exception type : ZeroDivisionError 
2022-10-29 19:37:47,174 debugger of foob                        wrapper on line         55: Exception message : division by zero
2022-10-29 19:37:47,174 debugger of foob                        wrapper on line         56: Stack trace : ['File : PATH/main.py , Line : 42, Name : wrapper, Message : result = func(*args, **kwargs)', 'File : /PATH/dev.py , Line : 6, Name : foob, Message : return b/0']
2022-10-29 19:37:47,174 debugger of foob                        wrapper on line         58: ========================================Do not use to classfromclevdebugimportdebug@debugclassA:def__init__(self,a,b):self.a=aself.b=bif__name__=='__main__':A(1,2)Output is:TypeError: Only functions or methods INSIDE a class can be debuggedInstallationpip install clevdebug