sysml-style
SysML v2 textual notation style checker and formatter. Lints and auto-formats .sysml files using configurable rules.
Installation
pip install sysmlpy # required dependency
pip install tomli # optional — only needed on Python < 3.11 for pyproject.toml config
Then run from the project root:
python -m sysml_style --help
Or install the package in editable mode:
pip install -e .
sysml-style --help
Usage
sysml-style check [OPTIONS] FILE [FILE ...]
sysml-style format [OPTIONS] FILE [FILE ...]
check — Lint files for style issues
sysml-style check uav.sysml
sysml-style check --ignore SML401,SML202 uav.sysml
sysml-style check --quiet uav.sysml
Issues are printed as:
file.sysml:3:5: SML101 expected spaces around '=' operator [fixable]
Exit code: 0 if no issues, 1 if issues found.
format — Auto-format files
sysml-style format uav.sysml # rewrites in-place
sysml-style format --check uav.sysml # exit 1 if would change (for CI)
sysml-style format --diff uav.sysml # show unified diff, don't write
sysml-style format --quiet uav.sysml
Exit code: 0 if no changes, 1 if --check would reformat, 2 on parse errors.
Config
Create a [tool.sysml-style] section in your pyproject.toml:
[tool.sysml-style]
max_line_length = 120
indent_size = 4
ignore = ["SML401", "SML202"]
naming_convention = "strict" # or "relaxed"
sysml-style walks up from the target file to find pyproject.toml. Use --config PATH to point to a specific file. Without a config file, sensible defaults are used.
Rules
SML1xx — Whitespace
| Code | Rule | Fixable |
|---|---|---|
| SML101 | Spaces around = and :>> operators |
yes |
| SML102 | No space before ; |
yes |
| SML103 | No trailing whitespace | yes |
| SML104 | Indentation is a multiple of the detected unit (2/3/4 spaces) | no |
| SML105 | Blank line between top-level definitions | yes |
| SML106 | Space before { |
yes |
SML2xx — Naming
| Code | Rule | Fixable |
|---|---|---|
| SML201 | Definition names should be UpperCamelCase | no |
| SML202 | Usage (feature) names should be lowerCamelCase | no |
| SML203 | Port names should end with Port suffix |
no |
| SML204 | Avoid spaces in element names; use CamelCase ⚠️ | no |
In relaxed naming mode, single-quoted names like 'My Part' are allowed without case enforcement.
⚠️ SML204 is a warning-level rule. Some organizations use spaces in quoted names for readability. Add
--ignore SML204if this doesn't fit your workflow.
SML3xx — Structure
| Code | Rule | Fixable |
|---|---|---|
| SML301 | import/alias before definitions |
no |
| SML302 | Empty block body {} can be omitted |
no |
| SML303 | Filename matches outermost package name ⚠️ |
no |
| SML304 | Usages should have a descriptive name (no anonymous usages; redefinitions excluded) | no |
| SML305 | import must have a visibility parameter (public/private/protected) |
yes |
⚠️ SML303 is a warning-level rule. Filename conventions vary across organizations — some use
snake_case.sysml, others mirror the package name exactly. Add--ignore SML303or setignore = ["SML303"]in your config if the rule doesn't fit your workflow.SML305 is fixable — the fix adds
publicbefore the import, which is the safest default visibility.
SML4xx — Idioms
| Code | Rule | Fixable |
|---|---|---|
| SML401 | Doc comment before element, not after ; |
no |
| SML402 | Use doc keyword for documentation comments |
no |
Metadata
Release files for sysml-style 0.3.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sysml_style-0.3.7.tar.gz | 12.8 kB | With provenance | Details for sysml_style-0.3.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sysml_style-0.3.7-py3-none-any.whl | Python 3 | none | any | Details for sysml_style-0.3.7-py3-none-any.whl |
Total release size: 24.4 kB
Release files / sysml_style-0.3.7.tar.gz
| Download URL | sysml_style-0.3.7.tar.gz |
|---|---|
| Size | 12.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ea0dc2d5d8b6601a224782c2eaa274a362a22c37f187082883f20ec7f9a88a5f
|
|
BLAKE2b-256 checksum How to use checksums |
a81da4b9b523afa497552f76a3b6c37e4d5c74f5fa4ed4669fbcff9bc31ef005
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 13, 2026.
Transparency logRelease files / sysml_style-0.3.7-py3-none-any.whl
| Download URL | sysml_style-0.3.7-py3-none-any.whl |
|---|---|
| Size | 11.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1309d34317d625a891ebc7e52ca468c9cd2b2e1dfa6c5905fff89095028ac23b
|
|
BLAKE2b-256 checksum How to use checksums |
5168aecf59b37f3a12e02880274e670d6094e7fed6ab9933d01f7288b2e055d7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 13, 2026.
Transparency logSecurity for sysml-style 0.3.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for sysml_style-0.3.7.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 13, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.