CLI
The command-line interface is implemented with Click and provides two commands:
Convert
Options:
| Option | Required | Values | Description |
|---|---|---|---|
INPUT_FILE |
yes | path | Python file containing a supported ODE convention. |
--output, -o |
yes | path | Output XML file for SBML or output directory for PEtab. |
--format, -f |
no | sbml, petab |
Output format. Default: sbml. |
PEtab export
This writes a PEtab bundle containing:
build/petab_problem/
├── <model_id>.xml
├── conditions.tsv
├── measurements.tsv
├── observables.tsv
├── parameters.tsv # only when parameters exist
└── petab_problem.yaml
PEtab output path
For --format petab, pass a directory path to --output, not an XML filename.
Validate
The validator prints a Rich table when warnings or errors are found. It exits with non-zero status if libSBML reports Error or Fatal diagnostics.
Validation is structural
SBML validation checks file consistency and SBML rules. It does not determine whether the model fits experimental data.
Auto-detection order
The CLI inspects the input Python file in this order:
modeldictionary with anodeskey → Convention B.odesdictionary whose keys are SymPy objects → Convention C.- callable named
model,ode,f, orrhs→ Convention A.
Failure mode
If Convention A is detected but state_vars is missing, conversion fails. Define state_vars explicitly because the AST parser cannot infer biological state names safely.