A collection of tools for Python that I created for my personal use.
│ .gitignore │ LICENSE │ README.adoc │ README.pdf │ ├───.github # GitHub CI │ └───workflows │ dependencies.txt # Dependencies for unit tests │ doc.yml # Convert README to PDF │ test.yml # Run unit tests and coverage │ ├───python_tools # Python package │ debug_tools.py │ math_tools.py │ __init__.py │ └───test # Package containing unit tests test_debug_tools.py test_math_tools.py __init__.pyTools that can be used for debugging.
A debug wrapper that prints some useful information about a function call.
This wrapper can be used by placing the corresponding decorator above the declaration of the function.
importpython_toolsaspt@pt.debugdefa_function(x, y, z): passThis wrapper can be used by placing the corresponding decorator above the declaration of the function.
importpython_toolsaspt@pt.timerdefa_function(x, y, z): passRuns a function and collects stdout during the execution of said function and returns the collected stdout as a string.
Tools related to mathematics
This function calculates the sum of all numbers from 1 to n.
This function returns n if it is a triangular number, or the next lower triangular number.
This function checks if a number is triangular.
Tools related to the internet and webpages.