Skip to main content

sbmlmath — a Python library for handling SBML MathML

PyPI - Version DOI

sbmlmath is a Python library for interconverting SymPy expressions and SBML-MathML. SBML uses a subset of MathML that this library aims to support. This is not (intended to be) a general MathML parser.

Main functionality:

  • sympy -> SBML MathML
  • SBML MathML -> sympy
    • in particular for cases where sympy.sympify(libsbml.formulaToL3String(...)) won't do the job (mind, e.g., the differences in operator precedence between sympy/Python and libsbml L3 formulas!)
    • retaining unit annotations and other <ci> attributes

NOTE: This is under development and the API is to be considered unstable

Python support policy: sbmlmath follows NEP 29.

Usage

from sbmlmath import SBMLMathMLPrinter, SBMLMathMLParser
import sympy as sp

sympy_expr = sp.sympify("A ** B + exp(C) * D")
mathml = SBMLMathMLPrinter().doprint(sympy_expr)
print(mathml)

cycled_sympy = SBMLMathMLParser().parse_str(mathml)
print(cycled_sympy)
assert sympy_expr == cycled_sympy

Documentation

Under construction at sbmlmath.readthedocs.io.

Installation

Releases from PyPI:

pip install sbmlmath

Releases from conda-forge:

conda install conda-forge::sbmlmath

The latest development version from GitHub:

pip install git+https://github.com/dweindl/sbmlmath.git

Metadata

Release files for sbmlmath 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sbmlmath 0.6.0
File Size Uploaded Provenance Actions
sbmlmath-0.6.0.tar.gz 38.5 kB With provenance Details for sbmlmath-0.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sbmlmath 0.6.0
File Interpreter ABI Platform Actions
sbmlmath-0.6.0-py3-none-any.whl Python 3 none any Details for sbmlmath-0.6.0-py3-none-any.whl

Total release size: 60.0 kB

Release files / sbmlmath-0.6.0.tar.gz

Download URL sbmlmath-0.6.0.tar.gz
Size 38.5 kB
Tags Source
SHA-256 checksum
How to use checksums
9a5f8376ecf448ff7686686d6cddfc7dc22ba7066a21b441c39eadef843e8965
BLAKE2b-256 checksum
How to use checksums
0ec71ff39a282f48cfc0f44a77c213813d96e4553bbfd156837613031b57c105
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

Release files / sbmlmath-0.6.0-py3-none-any.whl

Download URL sbmlmath-0.6.0-py3-none-any.whl
Size 21.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7bf6cc992461feba29909590e16755792ff1f996db97188cae4056ebf81bce1c
BLAKE2b-256 checksum
How to use checksums
e442d34577a0352e6715952e9870f76963adc4e56aefb3774842a33851795c87
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

Security for sbmlmath 0.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for sbmlmath-0.6.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page