Quickstart¶
Get up and running with the CML parser for both library and CLI usage.
Install¶
Using pip:
Using uv (recommended):
From source:
git clone https://github.com/martin882003/cml-parser.git
cd cml-parser
uv sync # or: python -m venv .venv && source .venv/bin/activate && pip install -e .
Parse a model¶
Error-tolerant parsing¶
from cml_parser import parse_file_safe
cml = parse_file_safe("path/to/model.cml")
if not cml.parse_results.ok:
for err in cml.parse_results.errors:
print(err.pretty())
CLI validation¶
You can validate a single file without writing code:
Flags:
--summary: prints counts of domains and context maps--json: emits the parse result (diagnostics and metadata) as JSON
Exit codes: 0 on success, 1 when parsing fails.