Skip to main content

Executable UML External Entity Operation Parser

Parses an *.op file (operation) to yield an abstract syntax tree using python named tuples

Why you need this

You need to process an *.op file in preparation for populating a database or some other purpose

Installation

Create or use a python 3.11+ environment. Then

% pip install op-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 op-parser.parser import OpParser

You then specify a path as shown:

result = OpParser.parse_file(file_input=path_to_file, debug=False)

The result will be a list of parsed operation statements. 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...

% eeop arrived-at-floor.op

The .op extension is not necessary, but the file must contain operation text. See this repository's wiki for more about the xsm language. The grammar is defined in the operation.peg file. (if the link breaks after I do some update to the code, just browse through the code looking for the operation.peg file, and let me know so I can fix it)

You can also specify a debug option like this:

% eeop arrived-at-floor.op -D

This will create a diagnostics folder in your current working directory and deposit a couple of PDFs defining the parse of both the state model grammar: operation_tree.pdf and your supplied text: operation.pdf.

You should also see a file named op-parser.log in a diagnostics directory within your working directory

Metadata

Release files for op-parser 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for op-parser 0.1.1
File Size Uploaded
op-parser-0.1.1.tar.gz 9.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for op-parser 0.1.1
File Interpreter ABI Platform
op_parser-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 18.7 kB

Release files / op-parser-0.1.1.tar.gz

Download URL op-parser-0.1.1.tar.gz
Size 9.2 kB
Tags Source
SHA-256 checksum
How to use checksums
8a5c8203089f9508c0d22d0b4142086975091072455843f0cac5c376020bb3d9
BLAKE2b-256 checksum
How to use checksums
8f5f04f8d2d998a5812c148aab381b4052875ea6f1b882b768e44e3b28d258bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release files / op_parser-0.1.1-py3-none-any.whl

Download URL op_parser-0.1.1-py3-none-any.whl
Size 9.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
268db1e9eea4cb949a2d5ee43289d3cc3ce2b04dc7ff02f55b964de62ab8f19e
BLAKE2b-256 checksum
How to use checksums
4042db81aff9584972f0d856bd71c50c9293a7e399554cf345804b1e84cf84f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

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