It converts MathML to LaTeX. Based on the Node.js version of the mathml-to-latex library.
pip install mathml-to-latexfrom mathml_to_latex.converter import MathMLToLaTeX
mathml = """
<math>
<mrow>
<mi>A</mi>
<mo>=</mo>
<mfenced open = "[" close="]">
<mtable>
<mtr>
<mtd><mi>x</mi></mtd>
<mtd><mi>y</mi></mtd>
</mtr>
<mtr>
<mtd><mi>z</mi></mtd>
<mtd><mi>w</mi></mtd>
</mtr>
</mtable>
</mfenced>
</mrow>
</math>
"""
result = MathMLToLaTeX().convert(mathml)
# A = \begin{bmatrix} x & y \\ z & w \end{bmatrix}python -m unittest discover testsdocker build -t mathml-to-latex-test .
docker run mathml-to-latex-test