Skip to main content

No project description provided

Project description

Pure Python library to convert MathML to OMML (Office Math Markup Language).

Installation

Use pip:

pip install mathml2omml

or, use setup.py:

python3 setup.py install

Usage

Mathml2omml takes a MathML as string, and outputs an OMML as string:

import mathml2omml

mathml = '<math><mi>x</mi><mo>+</mo><mi>y</mi></math>'
omml = math2omml.convert(mathml)

By default, mathml2omml recognises only entities defined in MathML specification. If the input includes other entities, pass the entity information as a dictionary to the second argument:

import html.entities

mathml = '<math><msubsup><mo>&int;</mo><mn>1</mn><mi>x</mi></msubsup></math>'
omml = math2omml.convert(mathml, html.entities.name2codepoint)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mathml2omml-0.0.2.tar.gz (23.3 kB view hashes)

Uploaded Source

Built Distribution

mathml2omml-0.0.2-py3-none-any.whl (23.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page