Repository navigation
Home
sysml2py is a pure-Python library for building SysML v2 models. You write
Python; it emits spec-correct .sysml notation. This wiki is the practical
guide — how to install it, build your first model, and go deeper.
For the project overview and the story behind the 1.0.0 overhaul, see the README.
- Getting Started — install, first model, dump
-
The Builder API — friendly names,
kind=,add() - Units — value-bearing attributes and automatic SI imports
- Provenance — reproducing exactly which inputs built your wheel
- Migrating from 0.5.x — what changed and how to move
- Class Catalog — every generated class, with worked examples
pip install sysml2pyfrom sysml2py import PackageBuilder, Part, Attribute
pkg = PackageBuilder('MyModel')
stage = Part('Stage_1')
stage.add(Attribute('mass'))
stage.add(Attribute('thrust'))
pkg.add(stage)
print(pkg.dump())package MyModel
{
part Stage_1
{
attribute mass;
attribute thrust;
}
}
Everything in this library — the AST node classes, the builders, and the
printer — is deterministically generated from the SysML v2 grammar by the
companion sysml2py-lab project, so it stays in lockstep with the language
instead of drifting behind a hand-written parser.
Keep the wiki in sync: the pages here are maintained alongside the code. If you find a mismatch between a wiki page and what the library actually does, file it on the
sysml2py-labrepo — generated behavior is generator error, not a license to hand-edit the library.