Model Layout Sheet Parser
Parses an *.mls file (Model Layout Sheet) to yield an abstract syntax tree using python named tuples
Why you need this
You need to process an *.mls file to layout a model diagram
Installation
Create or use a python 3.11+ environment. Then
% pip install mls-parser
At this point you can invoke the parser via the command line or from your python script.
From your python script
You need this import statement at a minimum:
from mls_parser.parser import LayoutParser
You can then specify a path as shown:
result = LayoutParser.parse_file(file_input=path_to_file, debug=False)
In either case, result will be a list of parsed class model elements. You may find the header of the visitor.py
file helpful in interpreting these results.
From the command line
This is not the intended usage scenario, but may be helpful for testing or exploration. Since the parser may generate some diagnostic info you may want to create a fresh working directory and cd into it first. From there...
% mls elevator.mls
The .xcm extension is not necessary, but the file must contain xcm text. See this repository's wiki for more about the mls language. The grammar is defined in the layout.peg file. (if the link breaks after I do some update to the code, just browse through the code looking for the class_model.peg file, and let me know so I can fix it)
You can also specify a debug option like this:
% mls elevator.mls -D
This will create a scrall-diagnostics folder in your current working directory and deposite a couple of PDFs defining
the parse of both the class model grammar: class_model_tree.pdf and your supplied text: class_model.pdf.
You should also see a file named mls_parser.log in a diagnostics directory within your working directory
Metadata
Release files for mls-parser 0.0.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mls_parser-0.0.7.tar.gz | 14.8 kB | Without provenance | Details for mls_parser-0.0.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mls_parser-0.0.7-py3-none-any.whl | Python 3 | none | any | Details for mls_parser-0.0.7-py3-none-any.whl |
Total release size: 30.2 kB
Release files / mls_parser-0.0.7.tar.gz
| Download URL | mls_parser-0.0.7.tar.gz |
|---|---|
| Size | 14.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bef562ad322bc28c2e2c45bd229c8a86b95170d28118cdfa902906357acdf8b8
|
|
BLAKE2b-256 checksum How to use checksums |
1f5346a7946649537962690d23d6724fe17a0044bac3fe64e182e07551e30eae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.13.2
|
Release files / mls_parser-0.0.7-py3-none-any.whl
| Download URL | mls_parser-0.0.7-py3-none-any.whl |
|---|---|
| Size | 15.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d9fff5657e52190059c8f6d1a2bdcd7e626295853abf29a419e9fd5a7617bacb
|
|
BLAKE2b-256 checksum How to use checksums |
8b97863037dcc5f891815be1eecdb3a6a1e6c873ec5d24662020cf66f11ed8b2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.13.2
|
Security for mls-parser 0.0.7
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.