Skip to main content

SysML v2 Python Units

Tests PyPI License

Convert units and quantities between standard SysML v2 and Python with Syside Automator and Pint.

Python API capabilities:

  • Get/set quantity* as attribute value, specified using Pint Quantity objects
  • Get/set unit as attribute value, specified using Pint Unit objects
  • Supports numerical values, as well as inf (* in SysML v2) and NaN (set as null in SysML v2)
  • Supports compound units, for example K·kg·s²/m³
  • Supports unit prefixes (kilo, mega, milli, etc.)
  • Supports percentages
  • Derive preferred units for a quantity type, for example kg for an ISQ::mass quantity
  • Gracefully handle units that are not supported by SysML v2: stored as doc _units /* <units> */ (opt-in)
  • Conversion functions between SysML v2 units and Pint Unit, and string parsing functions
  • Syside Automator ReferencePrinter for printing unit references using their short name
  • Extensive caching to make units lookup fast

*: a quantity is a combination of a numerical value (the "magnitude") and units, for example: 10 kg, -1.0 m/s**2.

Note: this package uses Syside Automator for parsing SysML v2 models. Syside Automator is commercial software, so you have to obtain a license first. For academic uses you can request an academic license.

Command line interface (CLI):

  • parse: parse quantity or units and get information about it
  • get: get the quantity or units assigned to a model element
  • set: set a quantity or units to a model element
  • convert: convert the quantity or units assigned to a model element to different units
  • list_units: list all available (directly-mappable, non-compound) units
  • list_quantity_types: list all available quantity types (e.g. length, mass, speed, etc.)

Installation

  1. Install the package from PyPI:
    pip install sysmlv2-units
    
    Note: currently Syside Automator only supports Python 3.12
  2. Make sure you activate Syside Automator

Usage

Refer to the documentation. Coverts both the Python API and CLI.

Citing

If you use this library in your work, please cite the paper that first introduces the use of these capabilities:

Bussemaker, J.H. et al., 2026, April. System Architecture Optimization Using SysML v2: Language Extension and Implementation. IEEE SysCon 2026, Halifax, Canada. doi: 10.1109/SysCon66367.2026.11503593

Contributing

The project is coordinated by: Jasper Bussemaker (jasper.bussemaker at dlr.de)

If you find a bug or have a feature request, please file an issue using the Github issue tracker. If you require support for using the library or want to collaborate, feel free to contact me.

Contributions are appreciated too:

  • Fork the repository
  • Add your contributions to the fork
    • Update/add documentation
    • Add tests and make sure they pass (tests are run using pytest)
  • Sign a Contributor License Agreement (CLA): please contact me for the template
  • Issue a pull request

Before running the documentation notebook, force Python to use utf-8 output:

set PYTHONUTF8=1
set PYTHONIOENCODING=utf-8
jupyter notebook

Metadata

Release files for sysmlv2-units 1.4.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 sysmlv2-units 1.4.0
File Size Uploaded Provenance Actions
sysmlv2_units-1.4.0.tar.gz 31.9 kB With provenance Details for sysmlv2_units-1.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sysmlv2-units 1.4.0
File Interpreter ABI Platform Actions
sysmlv2_units-1.4.0-py3-none-any.whl Python 3 none any Details for sysmlv2_units-1.4.0-py3-none-any.whl

Total release size: 59.6 kB

Release files / sysmlv2_units-1.4.0.tar.gz

Download URL sysmlv2_units-1.4.0.tar.gz
Size 31.9 kB
Tags Source
SHA-256 checksum
How to use checksums
ea6fd0632f447d912ecd79ef25c914507351fd5a6d685d619c9e44ea9b2c7f84
BLAKE2b-256 checksum
How to use checksums
4871e8b21ef5f8baaac37a9680f8f576d19cfb634d2844cfaf2c8c7849c38946
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 23, 2026.

Transparency log

Release files / sysmlv2_units-1.4.0-py3-none-any.whl

Download URL sysmlv2_units-1.4.0-py3-none-any.whl
Size 27.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
66923cfac6eeb949fe4f63ba002a75c32c298db0bc6a49d2c1bcf87d97cdec6a
BLAKE2b-256 checksum
How to use checksums
43b096450c1fa4924b45ff509087b3fc6b4ed799f32c8f432cad448c6bc299f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 23, 2026.

Transparency log

Security for sysmlv2-units 1.4.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for sysmlv2_units-1.4.0.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 Nov 23, 2026.

Transparency log

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