xcm-parser


Namexcm-parser JSON
Version 0.2.5 PyPI version JSON
download
home_page
SummaryExecutable Shlaer-Mellor Class Model Parser
upload_time2023-08-20 23:00:57
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 class model mbse xuml xtuml platform independent sysml
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Executable Class Model Parser

Parses an *.xcm file (Executable Class Model) to yield an abstract syntax tree using python named tuples

### Why you need this

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

### Installation

Create or use a python 3.11+ environment. Then

% pip install xcm-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 xcm-parser.parser import ClassModelParser

You can then specify a path as shown:

    result = ClassModelParser.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...

    % xcm elevator.xcm

The .xcm extension is not necessary, but the file must contain xcm text. See this repository's wiki for
more about the xcm language. The grammar is defined in the [class_model.peg](https://github.com/modelint/xcm-parser/blob/main/src/xcm_parser/class_model.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:

    % xcm elevator.xcm -D

This will create a scrall-diagnostics folder in your current working directory and deposite a coupel 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 `xcm-parser.log` in a diagnostics directory within your working directory

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "xcm-parser",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": "",
    "keywords": "action language,executable uml,class model,mbse,xuml,xtuml,platform independent,sysml",
    "author": "",
    "author_email": "Leon Starr <leon_starr@modelint.com>",
    "download_url": "https://files.pythonhosted.org/packages/d9/09/207310f3c52e117d89faf4936c0ce060c7fede4370ec13b7b39df7be7a91/xcm-parser-0.2.5.tar.gz",
    "platform": null,
    "description": "# Executable Class Model Parser\n\nParses an *.xcm file (Executable Class Model) to yield an abstract syntax tree using python named tuples\n\n### Why you need this\n\nYou need to process an *.xcm 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 xcm-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 xcm-parser.parser import ClassModelParser\n\nYou can then specify a path as shown:\n\n    result = ClassModelParser.parse_file(file_input=path_to_file, debug=False)\n\nIn either case, `result` will be a list of parsed class model elements. 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    % xcm elevator.xcm\n\nThe .xcm extension is not necessary, but the file must contain xcm text. See this repository's wiki for\nmore about the xcm language. The grammar is defined in the [class_model.peg](https://github.com/modelint/xcm-parser/blob/main/src/xcm_parser/class_model.peg) file. (if the link breaks after I do some update to the code, \njust browse through the code looking for the class_model.peg file, and let me know so I can fix it)\n\nYou can also specify a debug option like this:\n\n    % xcm elevator.xcm -D\n\nThis will create a scrall-diagnostics folder in your current working directory and deposite a coupel of PDFs defining\nthe parse of both the class model grammar: `class_model_tree.pdf` and your supplied text: `class_model.pdf`.\n\nYou should also see a file named `xcm-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 Model Parser",
    "version": "0.2.5",
    "project_urls": {
        "documentation": "https://github.com/modelint/xcm-parser/wiki",
        "repository": "https://github.com/modelint/xcm-parser"
    },
    "split_keywords": [
        "action language",
        "executable uml",
        "class model",
        "mbse",
        "xuml",
        "xtuml",
        "platform independent",
        "sysml"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2ed6fd48ef419de8a417f68c622f4d2abe67decd976980039c17629ee0ff0af2",
                "md5": "196889e1bd7640e5613df8cc0c3f1d2f",
                "sha256": "c0448175ff85b095b3bcfbe33253d4aad4a9f008f6b5ce8cadafa6c55725ce01"
            },
            "downloads": -1,
            "filename": "xcm_parser-0.2.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "196889e1bd7640e5613df8cc0c3f1d2f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 13363,
            "upload_time": "2023-08-20T23:00:55",
            "upload_time_iso_8601": "2023-08-20T23:00:55.787442Z",
            "url": "https://files.pythonhosted.org/packages/2e/d6/fd48ef419de8a417f68c622f4d2abe67decd976980039c17629ee0ff0af2/xcm_parser-0.2.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d909207310f3c52e117d89faf4936c0ce060c7fede4370ec13b7b39df7be7a91",
                "md5": "06c4973a79cf724b5f5496775f891f75",
                "sha256": "cf64b4b407f919e3b9687282f4680f1f3db5d78cdc1e35896cd554e3c4695db3"
            },
            "downloads": -1,
            "filename": "xcm-parser-0.2.5.tar.gz",
            "has_sig": false,
            "md5_digest": "06c4973a79cf724b5f5496775f891f75",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 12736,
            "upload_time": "2023-08-20T23:00:57",
            "upload_time_iso_8601": "2023-08-20T23:00:57.276100Z",
            "url": "https://files.pythonhosted.org/packages/d9/09/207310f3c52e117d89faf4936c0ce060c7fede4370ec13b7b39df7be7a91/xcm-parser-0.2.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-20 23:00:57",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "modelint",
    "github_project": "xcm-parser",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "xcm-parser"
}
        
Elapsed time: 0.12457s