I have been using it to produce images for my book and am very happy with it. There is tutorial here that shows you the syntax [3].
[1] https://pypi.org/project/pytikz/
[2] https://github.com/allefeld/pytikz
[3] https://nbviewer.org/github/allefeld/pytikz/blob/master/pyti...