Python runtime and local web viewer for MBSE JSON models.
Project description
MBSE
Python runtime and local web viewer for MBSE JSON models.
Install
pip install mbse
The web viewer requires Graphviz and its dot
command on PATH.
# Ubuntu/Debian
sudo apt install graphviz
# macOS
brew install graphviz
On Windows, install Graphviz from its download page
and add its bin directory to PATH.
Model Validation And Discovery
Load a project to validate its project document and every recognized MBSE JSON
model below project_root. The registry rejects duplicate model ids, multiple
contexts, and invalid entrypoints.
from mbse.model.project.project_registry import ProjectRegistry
registry = ProjectRegistry.load("project.json")
models = registry.iterExecutableModels()
print([model.getDocumentId() for model in models])
The registry validates JSON shape. Action-language handlers are normal Python imports and must be available in the active environment when the runtime executes them.
Automated Runtime Tests
from mbse.model.project.project_registry import ProjectRegistry
from mbse.runtime.runtime import Runtime
registry = ProjectRegistry.load("project.json")
runtime = Runtime()
runtime.init(registry)
runtime.play()
runtime.sendEvent("start") # A declared HSM event.
assert runtime.getState()["id"] == "running"
Use getExecutionLog(), getVariable(), and getState() for assertions.
sendEvent() and getState() require an HSM project entrypoint. See the
Runtime Layer for stepping and inspection.
Web Viewer
mbse-view project.json --open-browser
Run the packaged elevator example with nested Activity models:
mbse-example-view
The viewer lists every executable model, renders its diagram, and provides
events, typed variables, execution logs, model-call stepping, and breakpoints.
It is a local debugging tool that listens on 127.0.0.1 by default.
The viewer requires an HSM project entrypoint. Activity models can be rendered, listed, and debugged when called from that entrypoint.
Documentation
- Model Layer: JSON schemas, validation, and project discovery.
- Context Model, HSM Model, Activity Model, and Project Model: authoring formats.
- Runtime Layer: execution and test API.
- HSM Runtime and Activity Runtime: execution semantics.
- Viewer Server, Render Layer, and Browser Viewer: local visual debugging architecture.
- Reference Project: runnable multi-model fixture used by the test suite.
- Elevator Example: packaged viewer demonstration with nested Activity models.
- Test Suite: executable coverage and fixture documentation.
Development
python -m venv .venv
source .venv/bin/activate
pip install -e ".[test]"
ruff check .
pytest
VS Code users can run the ✅ Run CI status-bar button to create .venv when
needed and execute the same validation steps as CI locally.
Releases
One-Time Setup
Configure a branch protection rule for main that requires pull requests and
the CI / test status check before merging. Do not push directly to main.
Configure a PyPI pending publisher with:
- Project name:
mbse - GitHub owner:
<owner> - Repository:
<repository> - Workflow:
release.yml - Environment:
pypi
Change Flow
- Create a branch and open a pull request against
main. - Merge only after
CI / testpasses.
Release Flow
- After the release changes are merged, create and push a version tag:
git tag v0.1.0
git push origin v0.1.0
The publish workflow validates, builds, and uploads the package to PyPI. A failed workflow never uploads a package, but does not remove the pushed tag.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mbse-0.1.0.tar.gz.
File metadata
- Download URL: mbse-0.1.0.tar.gz
- Upload date:
- Size: 116.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e1c8ed8a3db7785347d3c416d964b7ebcd7c4199d5a50c894bb6fdd7ca09dd21
|
|
| MD5 |
2f0117e816295553621dc252f05d530e
|
|
| BLAKE2b-256 |
333c2fa5446668ea87a5832069d4919dab63a7f4aa7d374b51a6286f0bfa644a
|
Provenance
The following attestation bundles were made for mbse-0.1.0.tar.gz:
Publisher:
release.yml on FBS93/mbse
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mbse-0.1.0.tar.gz -
Subject digest:
e1c8ed8a3db7785347d3c416d964b7ebcd7c4199d5a50c894bb6fdd7ca09dd21 - Sigstore transparency entry: 2186885713
- Sigstore integration time:
-
Permalink:
FBS93/mbse@f1eb7125810a46166fa6e8344d11e37dca5dafea -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/FBS93
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f1eb7125810a46166fa6e8344d11e37dca5dafea -
Trigger Event:
push
-
Statement type:
File details
Details for the file mbse-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mbse-0.1.0-py3-none-any.whl
- Upload date:
- Size: 116.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
44d2a36ff0d6195efeec03f7d3907c75e097be35a48aebaafa986f7b3c9be4c1
|
|
| MD5 |
77e54bef2f2be4983d4b3ec620cfbd7e
|
|
| BLAKE2b-256 |
ded7507286ed78215d02bad7b075237c3d3b0a06fa1750f3cad7d8ac8d585542
|
Provenance
The following attestation bundles were made for mbse-0.1.0-py3-none-any.whl:
Publisher:
release.yml on FBS93/mbse
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mbse-0.1.0-py3-none-any.whl -
Subject digest:
44d2a36ff0d6195efeec03f7d3907c75e097be35a48aebaafa986f7b3c9be4c1 - Sigstore transparency entry: 2186885804
- Sigstore integration time:
-
Permalink:
FBS93/mbse@f1eb7125810a46166fa6e8344d11e37dca5dafea -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/FBS93
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f1eb7125810a46166fa6e8344d11e37dca5dafea -
Trigger Event:
push
-
Statement type: