Skip to main content

pygments-sysml

Pygments lexers for the textual notations of the OMG Systems Modeling Language (SysML) v2 and the Kernel Modeling Language (KerML).

Lexer Aliases File names MIME type
SysMLLexer sysml, sysml2, sysmlv2 *.sysml text/x-sysml
KerMLLexer kerml *.kerml text/x-kerml

The lexers are a by-product of writing The SysML v2 Book. They are part of sysmlv2-syntax-highlight, which also has SysML v2 highlighting for highlight.js, Prism, Rouge, Chroma and Notepad++.

Installation and use

pip install pygments-sysml
pygmentize -l sysml -f html -O full -o model.html model.sysml

The package registers the lexers through Pygments' plugin entry points, so get_lexer_by_name('sysml'), get_lexer_for_filename('model.sysml'), pygmentize -l sysml, and tools built on Pygments (Sphinx, Material for MkDocs, Jupyter's nbconvert, LaTeX minted) find them once the package is installed. pygments_sysml/lexers.py has no dependencies besides Pygments and can also be used on its own: pygmentize -x -l lexers.py:SysMLLexer model.sysml.

Token types

Text Token type
Reserved keywords (part, def, specializes, ...) Keyword
true, false, null Keyword.Constant
User-defined keywords: prefix metadata such as #Safety Keyword
Notes: // ... and //* ... */ Comment.Single, Comment.Multiline
Regular comments: /* ... */ String
Strings: "..." String.Double, String.Escape
Numbers: 42, 1.5e3 Number.Integer, Number.Float
Names: Drone, 'Max. Speed' Name
Symbols and operators: :, :>>, ::, >=, @, ... Punctuation

A regular comment is a string because the parser turns it into the String-valued body of a comment, documentation or textual representation; only notes are ignored. Symbols are punctuation so that keywords stand out.

The package also contains an optional style, sysml-pilot, with the colours of the Eclipse editor of the SysML v2 Pilot Implementation: pygmentize -l sysml -f html -O full,style=sysml-pilot model.sysml.

Compatibility

The lexers use only RegexLexer and words(), available since Pygments 2.0. The tests pass with Pygments 2.5.2, 2.11.2, 2.18.0 and 2.21.0.

License

MIT, see LICENSE.

Metadata

Release files for pygments-sysml 1.0.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 pygments-sysml 1.0.0
File Size Uploaded Provenance Actions
pygments_sysml-1.0.0.tar.gz 8.8 kB With provenance Details for pygments_sysml-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pygments-sysml 1.0.0
File Interpreter ABI Platform Actions
pygments_sysml-1.0.0-py3-none-any.whl Python 3 none any Details for pygments_sysml-1.0.0-py3-none-any.whl

Total release size: 16.7 kB

Release files / pygments_sysml-1.0.0.tar.gz

Download URL pygments_sysml-1.0.0.tar.gz
Size 8.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e1eab6392fdba901c41750e9cb2ece82a1f744ce96c841fab95f02d0c5da92d3
BLAKE2b-256 checksum
How to use checksums
5aa17f963f6569805fe1af89e4652a652795d8633a7e2607e88fca5d751f1892
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 9, 2026.

Transparency log

Release files / pygments_sysml-1.0.0-py3-none-any.whl

Download URL pygments_sysml-1.0.0-py3-none-any.whl
Size 7.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6ea7ddde72d14823574611c1ddf34f8e04645a76d87016fe27890ce378aa7020
BLAKE2b-256 checksum
How to use checksums
17330e5e758d30705149ee828ded435ec8b7901377aa7dda53c2c7213a1c6897
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 9, 2026.

Transparency log

Security for pygments-sysml 1.0.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 pygments_sysml-1.0.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 9, 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.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files Full provenance

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