pylatexenc
Simple LaTeX parser providing latex-to-unicode and unicode-to-latex
...The library is designed to be as backward-compatible as reasonably possible and is able to run on old Python versions should it be necessary. (Use the setup.py script directly if you have Python 3.7, poetry doesn't seem to work with old Python versions.) The pylatexenc.latexencode module provides a function unicode_to_latex() which converts a Unicode string into LaTeX text and escape sequences. It should recognize accented characters and most math symbols. A couple of switches allow you to alter how this function behaves.