Skip to main content

windstorm

SysML 2.0 Analysis Toolset — model-driven templating for any text-based file.

PyPI version PyPI status Coverage Status Docstring Coverage MIT license


Overview

windstorm reads a SysML v2 analysis model — either from a live SysMLv2 API or from local .sysml files — and turns the model's parameter values into variables you can use inside any text-based template.

It extends Jinja2 with a custom windstorm(...) function, so anything Jinja can render (files, code, config, Excel workbooks) can be driven from your SysML model.


Installation

pip install sysml-windstorm

Requires Python 3.9+.


Quick start

Point windstorm at a model and render a template:

# Live API mode: pull parameters from a SysMLv2 API
windstorm -a http://your_api_address:9000 -p project_uuid element_name

# Local-file mode: use a directory of .sysml files (or exported JSON) instead
windstorm --source ./models element_name

Inside any text file, reference model values with Jinja:

{{ windstorm('myVar') }}

Run windstorm with that file's directory as the input:

windstorm --source ./models --in_directory ./templates --out_directory ./output element_name

Modes

1. Live SysMLv2 API (default)

When pointed at an appropriate SysMLv2 API, windstorm pulls all parameter values for the requested analysis element and makes them available to the Jinja templates.

windstorm -a http://your_api_address:9000 -p project_uuid element_name

2. Local files / offline (--source)

Since v0.6.0, windstorm can read a model entirely from local files — no API address and no network required:

windstorm --source ./models element_name

--source DIR accepts a directory that may contain both:

  • Raw .sysml files — windstorm runs the windtrader-java batch-export CLI (Java 21+) to produce the export JSON next to each source, then loads it. Set the jar location with the WINDTRADER_JAR environment variable.
  • Already-exported JSON (*.export.json) — loaded directly, no Java needed. This is the fastest path and is fully offline.

The two are complementary: a .sysml whose export is missing or older than the source is (re-)exported; an up-to-date export is reused. Mixing both in one tree is fine.

All files build an in-memory element store (the same API-shaped graph windstorm uses in live mode), so templating behaves identically.

Note: --source is deterministic given a stable set of exports. The jar writes <path>.export.json next to each source (the tree must be writable), and re-export happens only when an export is missing or older than or equal to its .sysml (equal catches same-tick writes). --dump-export-json DIR (must be outside --source) copies the full export bundle to a directory you can reuse as a Java-free --source on later runs.


Templating

Any text-based file (.json, .py, .txt, .m, ...) can be templated with Jinja. Versions after 0.4.0 also support Excel files, even though they are not pure text.

windstorm supports all Jinja features (for loops, if statements, filters, etc.) and adds the custom windstorm() function to resolve a model value by tool-variable name.

Example template (template.txt):

{{ windstorm('deltaT') }}

Example with a loop:

{% for w in windstorm('weights') %}{{ w }}{% if not loop.last %},{% endif %}{% endfor %}

Run windstorm with --in_directory (template folder) and --out_directory (rendered output):

windstorm -a http://your_api_address:9000 -p project_uuid \
  --in_directory ./templates --out_directory ./output \
  element_name

CLI reference

windstorm [element_name] [options]

Options:
  -a, --api URL              SysMLv2 API address (default: http://sysml2-dev.intercax.com:9000)
  -p, --project_id UUID      Specific project UUID (default: latest project)
  --source DIR               Read from local .sysml / .export.json files instead of an API
  --dump-export-json DIR     Copy the full export bundle to DIR (must be outside --source)
  --exports-only             Trust existing .export.json files; never invoke Java
  --skip-export-errors       Skip .sysml files whose export fails, don't abort
  -t, --element_type TYPE    Element type to select (default: AnalysisCaseDefinition; also AnalysisCaseUsage, VerificationCaseDefinition, VerificationCaseUsage)
  --in_directory DIR         Template input directory (default: .)
  --out_directory DIR        Rendered output directory (default: .)
  --insecure                 Disable TLS verification
  --debug                    Enable debug logging
  --force_render_error_continue  Keep rendering sibling files after an error

What windstorm extracts (element/marker contract)

Windstorm renders a model by selecting a case — an element of a supported element type — and walking its owned inputs for tool variables. For an element to be windstorm-visible, two things must line up:

  1. The element type is selectable. Pass it with -t / --element_type:

    • AnalysisCaseDefinition (the default) / AnalysisCaseUsage
    • VerificationCaseDefinition / VerificationCaseUsage Selection matches the element's exported @type exactly.
  2. The case carries a ToolExecution marker. The case (or its action) declares metadata ToolExecution { toolName = "Windstorm"; }. This is the marker windstorm uses to recognize a tool entry point. Its inputs then hang ToolVariable metadata: in <var> = <expr> {@ToolVariable {name = "<name>";}} — that <name> is the key you reference in templates via {{ windstorm("<name>") }}.

The supported scope is Analysis and Verification cases (issue #95). A minimal verification case looks like:

package Verify {
    public import AnalysisTooling::*;

    verification def verify_case1 {       // -> VerificationCaseDefinition
        subject A;
        metadata ToolExecution {          // -> windstorm-visible marker
            toolName = "Windstorm";
        }
        in engine_weight = 5.0 {@ToolVariable {name = "deltaT";}}
    }
}

Render it with:

windstorm verify_case1 --source models/ -t VerificationCaseDefinition

The adapter preserves these markers when reconstructing API-shaped payloads from the real Java export, so the contract holds end-to-end through the windtrader-java export round-trip.


Development

python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
pytest tests

The test suite uses committed mocks (API-shaped JSON under tests/mocks/) — no live API or Jupyter kernel required. To regenerate the mocks from the .sysml fixtures, run:

python ./tests/mocks/make_mocks.py

(Requires a SysML Jupyter kernel; CI does not do this — the committed mocks are authoritative for tests.)

Release

Releases are automated by the GitHub Release Workflow on every push to main:

  1. Tests + coverage must pass.
  2. python-semantic-release parses commit messages (emoji parser) to decide the next version:
    • :boom: → major bump
    • :sparkles: (and friends) → minor bump
    • :bug:, :ambulance:, etc. → patch bump
  3. On a release, the package is published to PyPI and a GitHub Release is created.

License

MIT

Metadata

Release files for sysml-windstorm 0.7.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sysml-windstorm 0.7.0
File Size Uploaded Provenance Actions
sysml_windstorm-0.7.0.tar.gz 28.1 kB Without provenance Details for sysml_windstorm-0.7.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sysml-windstorm 0.7.0
File Interpreter ABI Platform Actions
sysml_windstorm-0.7.0-py3-none-any.whl Python 3 none any Details for sysml_windstorm-0.7.0-py3-none-any.whl

Total release size: 57.5 kB

Release files / sysml_windstorm-0.7.0.tar.gz

Download URL sysml_windstorm-0.7.0.tar.gz
Size 28.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f1fd07555a704a9979ee680029b15918e07de96c44891317fd7d8586401ef1cb
BLAKE2b-256 checksum
How to use checksums
89bb1f79074adaf1e3385f858305eec42210bad501c68c3ffab74aa5d3391d7b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / sysml_windstorm-0.7.0-py3-none-any.whl

Download URL sysml_windstorm-0.7.0-py3-none-any.whl
Size 29.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
164940a802d2e5db325e0da6bcdc485823e70fe0ecf28b67feaab78ab14926f4
BLAKE2b-256 checksum
How to use checksums
3f249394c990890ab1306db0997c1b5d3767aabe416727294da7fbbad2f06a34
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for sysml-windstorm 0.7.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page