skillfed

py-asciimath

A simple converter from ASCIIMath/MathML to LaTeX/MathML

py-asciimath v0.3.0 1.1M downloads/30d#4,383 on PyPI42
Permissive license Abandoned released

What it is and what it does

py-asciimath is a translation layer between three mathematical notation formats: ASCIIMath (a human-readable markup), LaTeX (typesetting), and MathML (XML-based mathematical markup). It exposes translator classes for each conversion pair—ASCIIMath2MathML, ASCIIMath2Tex, MathML2Tex, and Tex2ASCIIMath—plus a command-line tool for batch conversions.

The package parses ASCIIMath using lark-parser and relies on lxml for XML handling. It is useful for workflows that need to move mathematical expressions between different systems—for instance, converting user-friendly ASCIIMath input into LaTeX for document generation or MathML for web display. The package is abandoned (last release April 2020), so it should be treated as a stable but unmaintained tool.

Use it for:

  • Convert ASCIIMath notation from user input into LaTeX for PDF document generation in educational or scientific applications.
  • Transform MathML from web sources into LaTeX for inclusion in academic papers or typeset documents.
  • Batch-convert mathematical expressions via the command-line interface for data pipeline or content migration tasks.
  • Parse and validate ASCIIMath expressions as part of a math-aware text editor or note-taking application.
  • Generate MathML from LaTeX for embedding mathematical content in web pages or EPUB documents.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Converts between ASCIIMath, LaTeX, and MathML mathematical notation formats, with bidirectional translation support and a command-line interface.

Yes, if you need bidirectional translation between ASCIIMath, LaTeX, and MathML and can accept an unmaintained package. The code is stable, has no known vulnerabilities, and the three dependencies are lightweight. Install friction is low. However, do not rely on it for new features or bug fixes—treat it as a snapshot tool. If you need active maintenance or support, consider alternatives.

Install

py-asciimath on PyPI

pip

pip install py-asciimath

uv

uv add py-asciimath

poetry

poetry add py-asciimath

Installing py-asciimath

Before you install

Low install friction with three straightforward dependencies (lark-parser, docopt, lxml). However, the package is abandoned—last commit was 2023-07-28 and no releases since 2020-04-22. Consider this a stable snapshot rather than actively maintained software.

License in practice

Licensed under MIT (permissive), so you can use, modify, and distribute it freely with minimal restrictions.

Quickstart

from py_asciimath.translator.translator import ASCIIMath2Tex

asciimath2tex = ASCIIMath2Tex()
result = asciimath2tex.translate(r"e^x > 0 forall x in RR")
print(result)

Verify before relying

  • Whether MathML-to-LaTeX conversion via XSLT MathML Library is fully functional or has known limitations beyond what the fact sheet documents.
  • Current compatibility with modern Python versions beyond 3.9, given the package is abandoned and last tested on 3.5–3.9.
  • Whether the command-line interface remains fully functional or has bitrot issues.

Package facts

License not declared (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 3 — lark-parser, docopt, lxml
Maintenance abandoned — 2,305 days since the last release
Last repo commit
First released
Downloads 1,086,732/month — #4,383 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: py_asciimath-0.3.0-py2.py3-none-any.whl

License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

asciimath to latex convertermathml latex translationmathematical notation parserasciimath mathml conversionlatex to asciimathmath markup language converterequation format translator
math-notationformat-conversion

More Markup packages

PyYAML

PyYAML parses and emits YAML 1.1 data format,…

permissive · top 100 on PyPI

markdown-it-py

A Python markdown parser that converts markdown…

permissive · top 100 on PyPI

beautifulsoup4

Beautiful Soup parses HTML and XML documents…

permissive · top 100 on PyPI

et-xmlfile

et_xmlfile writes large XML files with minimal…

permissive · top 1,000 on PyPI

tomlkit

Parses and edits TOML files while preserving…

permissive · top 1,000 on PyPI

docstring-parser

Parses Python docstrings in ReST, Google,…

permissive · top 1,000 on PyPI

latex2mathml

Converts LaTeX mathematical expressions to…

permissive · top 5,000 on PyPI

latex2sympy2

Parses LaTeX math expressions and converts them…

permissive · top 15,000 on PyPI

pypptx-with-oxml

Reads, creates, and updates PowerPoint (.pptx)…

permissive · top 15,000 on PyPI

latex2sympy2-extended

Parses LaTeX math expressions and converts them…

permissive · top 5,000 on PyPI

pylatexenc

Converts between LaTeX code and Unicode text in…

permissive · top 5,000 on PyPI

sphinxcontrib-katex

A Sphinx extension that renders mathematical…

permissive · top 15,000 on PyPI

math-verify

Evaluates mathematical expressions from LLM…

permissive · top 5,000 on PyPI

sphinxcontrib-jsmath

A Sphinx extension that renders mathematical…

permissive · top 1,000 on PyPI

dicttoxml

Converts Python dictionaries and other native…

copyleft · top 5,000 on PyPI

itanium-demangler

Parses Itanium C++ ABI mangled symbols into an…

permissive · top 15,000 on PyPI