Skip to main content

Convert MathML to OMML (Allote.Software fork)

Project description

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

Installation

Use pip:

pip install mathml2omml_as

or, use setup.py:

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_as-0.1.0.tar.gz (25.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mathml2omml_as-0.1.0-py3-none-any.whl (24.8 kB view details)

Uploaded Python 3

File details

Details for the file mathml2omml_as-0.1.0.tar.gz.

File metadata

  • Download URL: mathml2omml_as-0.1.0.tar.gz
  • Upload date:
  • Size: 25.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.5

File hashes

Hashes for mathml2omml_as-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a6defed2573a9eb9f76a0ffe56e946bd86b904f01743cdc2879a5edd1457cd7a
MD5 127f0afd459c1534b033f6d723380bab
BLAKE2b-256 294ccf348f43eca6170c1d6e80171c01879fe6f935c00cead4a0a0c8061fc8b1

See more details on using hashes here.

File details

Details for the file mathml2omml_as-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mathml2omml_as-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 24.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.5

File hashes

Hashes for mathml2omml_as-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 20ee45f45ced7cb2414b6b627c6bae25c43f2b4d44c9d89902c582b3755dc95b
MD5 9db7001035ce2a4490256a669bf9d1bc
BLAKE2b-256 006924017fe54856f99b466f973389a2e66299beb4036916e339a1ba2ea2dda3

See more details on using hashes here.

Supported by

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