Reports from python¶
sbml4humans writes the browser application and your model into one portable HTML file. Open that file directly in a modern browser. Report generation, validation and model exports run in browser workers; Python starts no server and installs no runtime dependencies.
Installation¶
from sbml4humans import report, show
# Write a portable HTML report without opening a browser.
output = report("model.xml", "model-report.html")
# Write the report and open its file:// URL in the default browser.
show("model.omex")
The command line accepts SBML, CellML, gzip files and COMBINE archives:
What happens¶
The package embeds the exact original source bytes in the bundled HTML application. The browser admits and parses the source with the same pinned Rust/WASM pipeline as the hosted static application. The HTML includes its scripts, styles, fonts, workers and WASM libraries, so reports, mathematical views, validation, Antimony and the code/document exports work offline. Annotation descriptions from public metadata providers require an internet connection; original annotations, identifiers and model notes remain available offline.
Prefer a COMBINE archive for models with external comp definitions. For loose files, explicitly name the companion files. They must be inside the source directory; other neighboring files are never collected automatically.
The input and total uncompressed companion bundle are limited to 100 MB. All archive and comp expansion limits still apply in the browser. Both functions return the absolute path of the created HTML file. show(..., open_browser=False) writes it without launching the browser.
Who can read the reports¶
Anyone with the HTML file can read the embedded model. Keep reports containing private models private. Files are written atomically with private file permissions. Neither report nor show uploads the source, contacts a report API or leaves a listening service running.