I think that should be possible using the
sagetex package; its documentation is available here on CTAN. The package allows you to run a computer algebra system called Sage. This means Sage needs to be installed locally on your computer or, even easier, you can get a free Cocal account, formerly known as SagemathCloud. The
sagetex package is an easy way of getting the power of Python plus all the built in mathematics of Sage. I uploaded a python file to Cocal that calculates the beginning of the Recaman sequence. The code itself isn't important, the important thing is that the results of running the program were contained ni a string called
sagesilent block allows Sage code to run but it doesn't show anything in the LaTeX code. In this case, I just loaded the Python program and ran it. In the body of the LaTeX document, the \sagestr command tells Sage to grab the string output and put it into the document. Calculations can be done using the \sage command. You can search this site for sagetex to see more about its use. Note the picture below shows the Python document and LaTeX document are in the same directory.
The result is:
I don't know anything about your other extensions but clearly the Python file was imported, ran, and the output was incorporated into a LaTeX document. Documentation for Sage is here. The Cocal website linked above, says:
"CoCalc is a sophisticated web service for online computation:
Mathematical calculation: SageMath, SymPy, Maxima;
Statistical analysis: R project, Pandas, statsmodels, scikit-learn, Tensorflow, NLTK;
Various other computation: Octave, Julia, etc." so there are a lot of possibilities.