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__.py
Tools 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.
import python_tools as pt
@pt.debug
def a_function(x, y, z):
pass
This wrapper can be used by placing the corresponding decorator above the declaration of the function.
import python_tools as pt
@pt.timer
def a_function(x, y, z):
pass
Runs 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.
Tests if a webpage is up (returns 200).