sbmltoodejax.parse.ParseSBMLFile(file: str)[source]#

Wrapper of SBMLtoODEpy’s ParseSBMLFile function. This function extract the SBML model’s elements using libSBML, and returns an instance ModelData which is intended to be then passed to the GenerateModel().

See also

This function buils upon SBMLtoODEpy ParseSBMLFile function, see their documentation at


Here, at the difference of the original SBMLtoODEpy’s function, ParseSBMLFile:

  • takes as input a string which can be a filepath but also directly a string containing the content of the file (allows to directly parse online-hosted SBML files, see Example)

  • raises an error if the SBML model contains Events (not handled yet neither in SBMLtoODEpy nor in SBMLtoODEjax)


file (str) – can be either the filepath of the SBML model to be parsed or a string with the content of the file


An sbmltoodepy object containing the model’s components and their properties

Return type:

modelData (sbmltoodepy.dataclasses.ModelData)

  • ValueError – if there is an error during LibSBML reading of the file

  • NotImplementedError – if the SBML model contains events


from sbmltoodejax.parse import ParseSBMLFile
from urllib.request import urlopen

model_idx = 647
model_url = f"{model_idx:010d}.2?filename=BIOMD{model_idx:010d}_url.xml"
with urlopen(model_url) as response:
    model_xml_body ="utf-8")
model_data = ParseSBMLFile(model_xml_body)