windtrader is a lightweight Python wrapper around the windtrader-java SysML v2 validator.
It provides a simple, scriptable way to validate SysML v2 textual syntax from Python while
delegating all grammar authority to the official Java-based validator.
This project is intentionally parse-only: it validates syntax, reports diagnostics, and (optionally) echoes parsed output, but does not perform semantic resolution or model linking.
- ✅ Validates SysML v2 textual syntax using a pinned Java validator
- 🧩 Thin, explicit Python API (no hidden model interpretation)
- 📦 Automatic download and caching of the validator JAR
- 🧪 Designed for CI, generators, and downstream tooling
- 🔐 Stable exit-code contract from Java → Python
pip install windtraderOr for development:
pip install -e ".[dev]"Java must be available on your system (CI uses Temurin JDK).
echo "part { attribute mass; }" | windtraderOptions:
--version Show windtrader package version
--java-version windtrader-java version to use (default: 0.1.1)
--timeout Validation timeout in seconds
The CLI forwards stdout/stderr directly from the Java tool and exits with the same exit code.
from windtrader import validate
result = validate("part { attribute mass; }")
if result.ok:
print("Valid SysML")
else:
print("Invalid:", result.stderr)from windtrader.validator import WindtraderValidator
v = WindtraderValidator(version="0.1.1")
res = v.validate("part { attrib mass; }")
print(res.exit_code) # 0 = valid, 2 = syntax error, 3 = runtime errorReturned objects include:
ok: boolean success flagexit_code: Java exit codestdout/stderr: raw tool outputjar_path: cached JAR locationduration_s: execution timeis_invalid_syntaxis_runtime_error
The Java validator defines:
| Exit Code | Meaning |
|---|---|
| 0 | Valid syntax |
| 2 | Invalid SysML |
| 3 | Runtime error |
Python preserves these codes exactly.
Environment variables:
WINDTRADER_CACHE_DIR– override JAR cache directoryWINDTRADER_JAVA_REPO– override GitHub repo for JAR downloadsWINDTRADER_JAVA_STABLE_ASSET– explicit asset URL (optional)
- Grammar is authoritative: validation truth lives in Java
- Python is orchestration only
- No silent fallbacks
- Reproducible CI behavior
This makes windtrader suitable as a foundation for:
- Code generators
- Corpus analysis
- Model-building libraries
- CI validation gates
windtrader is designed to act as the validation backbone for higher-level SysML tooling,
including programmatic builders and corpus-driven API generation pipelines.
MIT License. See LICENSE.
Pull requests welcome. Please ensure:
- CI passes
- Docstring coverage remains high
- Validator version bumps are intentional