mtd-parser


Namemtd-parser JSON
Version 0.1.0 PyPI version JSON
download
home_page
SummaryExecutable Shlaer-Mellor Class Method Parser
upload_time2023-08-19 00:40:25
maintainer
docs_urlNone
author
requires_python>=3.11
licenseMIT License Copyright (c) 2019-2023 Leon Starr Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords action language executable uml method class method mbse xuml xtuml platform independent sysml
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Executable UML Class Method Parser

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

### Why you need this

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

### Installation

Create or use a python 3.11+ environment. Then

% pip install mtd-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 mtd-parser.parser import MethodParser

You then specify a path as shown:

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

In either case, `result` will be a list of parsed scrall 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...

    % mtd ping.mtd

The .mtd extension is not necessary, but the file must contain mtd text. See this repository's wiki for
more about the xsm language. The grammar is defined in the [method.peg](https://github.com/modelint/mtd-parser/blob/main/src/mtd_parser/method.peg) file. (if the link breaks after I do some update to the code, 
just browse through the code looking for the method.peg file, and let me know so I can fix it)

You can also specify a debug option like this:

    % mtd ping.mtd -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: `method_tree.pdf` and your supplied text: `method.pdf`.

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

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "mtd-parser",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": "",
    "keywords": "action language,executable uml,method,class method,mbse,xuml,xtuml,platform independent,sysml",
    "author": "",
    "author_email": "Leon Starr <leon_starr@modelint.com>",
    "download_url": "https://files.pythonhosted.org/packages/5d/89/d790029e94f65d13ed482d38759e3278caf1f3d6fd12caf78b50e171329f/mtd-parser-0.1.0.tar.gz",
    "platform": null,
    "description": "# Executable UML Class Method Parser\n\nParses an *.mtd file (method) to yield an abstract syntax tree using python named tuples\n\n### Why you need this\n\nYou need to process an *.mtd file in preparation for populating a database or some other purpose\n\n### Installation\n\nCreate or use a python 3.11+ environment. Then\n\n% pip install mtd-parser\n\nAt this point you can invoke the parser via the command line or from your python script.\n\n#### From your python script\n\nYou need this import statement at a minimum:\n\n    from mtd-parser.parser import MethodParser\n\nYou then specify a path as shown:\n\n    result = MethodParser.parse_file(file_input=path_to_file, debug=False)\n\nIn either case, `result` will be a list of parsed scrall statements. You may find the header of the `visitor.py`\nfile helpful in interpreting these results.\n\n#### From the command line\n\nThis is not the intended usage scenario, but may be helpful for testing or exploration. Since the parser\nmay generate some diagnostic info you may want to create a fresh working directory and cd into it\nfirst. From there...\n\n    % mtd ping.mtd\n\nThe .mtd extension is not necessary, but the file must contain mtd text. See this repository's wiki for\nmore about the xsm language. The grammar is defined in the [method.peg](https://github.com/modelint/mtd-parser/blob/main/src/mtd_parser/method.peg) file. (if the link breaks after I do some update to the code, \njust browse through the code looking for the method.peg file, and let me know so I can fix it)\n\nYou can also specify a debug option like this:\n\n    % mtd ping.mtd -D\n\nThis will create a diagnostics folder in your current working directory and deposit a couple of PDFs defining\nthe parse of both the state model grammar: `method_tree.pdf` and your supplied text: `method.pdf`.\n\nYou should also see a file named `mtd-parser.log` in a diagnostics directory within your working directory\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2019-2023 Leon Starr  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "Executable Shlaer-Mellor Class Method Parser",
    "version": "0.1.0",
    "project_urls": {
        "documentation": "https://github.com/modelint/mtd-parser/wiki",
        "repository": "https://github.com/modelint/mtd-parser"
    },
    "split_keywords": [
        "action language",
        "executable uml",
        "method",
        "class method",
        "mbse",
        "xuml",
        "xtuml",
        "platform independent",
        "sysml"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "dcb8ac3088a95c269b132c5ae6de21af8b5635cfe2b97216cb7ac4709c1d52e7",
                "md5": "cbbec861981f46b42022c1a629bb281a",
                "sha256": "dd4944b748cfad05671299099134a1bc0eea8cd4fe694cae30d36eeb4087af84"
            },
            "downloads": -1,
            "filename": "mtd_parser-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "cbbec861981f46b42022c1a629bb281a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 9192,
            "upload_time": "2023-08-19T00:40:23",
            "upload_time_iso_8601": "2023-08-19T00:40:23.976412Z",
            "url": "https://files.pythonhosted.org/packages/dc/b8/ac3088a95c269b132c5ae6de21af8b5635cfe2b97216cb7ac4709c1d52e7/mtd_parser-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5d89d790029e94f65d13ed482d38759e3278caf1f3d6fd12caf78b50e171329f",
                "md5": "847e44132c8928e58081073a232f83de",
                "sha256": "52edd6c6e6fe2a571c52b02e0e7963c356998f5dbbe994d772fa7459a20e20bc"
            },
            "downloads": -1,
            "filename": "mtd-parser-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "847e44132c8928e58081073a232f83de",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 8980,
            "upload_time": "2023-08-19T00:40:25",
            "upload_time_iso_8601": "2023-08-19T00:40:25.813892Z",
            "url": "https://files.pythonhosted.org/packages/5d/89/d790029e94f65d13ed482d38759e3278caf1f3d6fd12caf78b50e171329f/mtd-parser-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-19 00:40:25",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "modelint",
    "github_project": "mtd-parser",
    "github_not_found": true,
    "lcname": "mtd-parser"
}
        
Elapsed time: 0.11052s