A huge thanks to Curtis White for creating a robust Python API for the PTHAT.
It is very easy to use and can easily build the commands exactly as specified in your published API.
Also It is open source with the Apache V2 license so anyone can use it on any project.
Please follow the links below for more information:
Source Code:
https://github.com/drizztguen77/PTHat
Documentation:
https://pthat.readthedocs.io/
Other Info:
https://pypi.org/project/pthat/