opensysml
opensysml is the Python client for the OpenSysML SysML v2 parser, model
analysis and execution service. Load SysML models, inspect symbols and
diagnostics, evaluate values, verify constraints, run behaviors, edit source,
and query model documents from Python.
Install
Python 3.10 or later is required. Install the published package from PyPI:
pip install opensysml
The runtime dependencies are grpcio>=1.83.0, protobuf>=7.35.1 and
sigstore>=4.5.0,<5.
Quickstart
import opensysml
source = """\
package Demo {
part def Vehicle {
attribute mass default = 1500.0;
}
part sedan : Vehicle {
attribute :>> mass = 1800.0;
}
}
"""
model = opensysml.loads(source)
if not model.ok:
for diagnostic in model.diagnostics:
print(diagnostic)
raise SystemExit("The model has errors.")
print(model.eval("mass", subject="Demo::sedan"))
1800.0
The service
The client talks to a sysml-grpc service. You do not have to install or
start one: the first connection starts a private service for the current
interpreter and stops it when the interpreter exits.
To find the service binary, the client checks, in order:
$OPENSYSML_BINARY, if set.- The shared cache at
~/.opensysml/bin/sysml-grpc. - A download of the OpenSysML release this package was built against.
- A
sysml-grpcon$PATH.
A downloaded binary is verified against a SHA-256 digest shipped inside the
package, so a normal pip install opensysml followed by opensysml.connect()
needs no environment variables and no extra setup. Downloading another release
is also verified, through its signed checksum manifest; an unverifiable download
is refused rather than trusted.
To use a service you run yourself, pass its address:
model = opensysml.connect("localhost:50051").load("model.sysml")
The Python client guide covers the cache, offline use, trust configuration and connecting to an external service.
Documentation
To install from a checkout, run tests, regenerate protobufs or pin release digests, see DEVELOPING.md.
Metadata
Release files for opensysml 0.9.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| opensysml-0.9.2.tar.gz | 383.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| opensysml-0.9.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 590.9 kB
Release files / opensysml-0.9.2.tar.gz
| Download URL | opensysml-0.9.2.tar.gz |
|---|---|
| Size | 383.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cf34f46dec9dc3b63454092275fb1ade45c8e66c0e54a62b8b2a1cdb0e14754f
|
|
BLAKE2b-256 checksum How to use checksums |
d975b115d91a33944cb1a291c5c6651bf4a79861c8cee4cda2bf15c37b96e6a9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.17
|
Release files / opensysml-0.9.2-py3-none-any.whl
| Download URL | opensysml-0.9.2-py3-none-any.whl |
|---|---|
| Size | 207.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c7a74dccb96cdae2e872f94781aa2ab46ca931a51586535114607e72e190eb2d
|
|
BLAKE2b-256 checksum How to use checksums |
5a5e78eec7bf2110c7a564a3752ac67293a3724060abb9125d5d872cd8415bf6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.17
|