Thread Calculator for CNC

I had a class where I learned how to write G-codes (I assume you know it). We would write G-codes to machine workpieces that had external and internal threads. However, to write a proper G-code considering these features, one needs to calculate certain thread cutting parameters, such as depth of cut, number of passes, depth of cut per pass and so on. Calculating a whole list of such parameters requires looking up ISO standards for thread sizes, and formulas. For this purpose, I wrote this python-based thread calculator, which calculates all these parameters based on just two inputs: thread's standard designation, and its length as shown in the technical drawing. You can browse its source code and try it out yourself.