cedarscript-ast-parser


Namecedarscript-ast-parser JSON
Version 0.7.0 PyPI version JSON
download
home_pageNone
SummaryA library for parsing and interpreting CEDARScript, a SQL-like language for code analysis and transformations
upload_time2024-12-12 06:32:43
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseApache-2.0
keywords parser ast cedarscript code-editing refactoring code-analysis sql-like ai-assisted-development
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # CEDARScript AST Parser

[![PyPI version](https://badge.fury.io/py/cedarscript-ast-parser.svg)](https://pypi.org/project/cedarscript-ast-parser/)
[![Python Versions](https://img.shields.io/pypi/pyversions/cedarscript-ast-parser.svg)](https://pypi.org/project/cedarscript-ast-parser/)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)

`CEDARScript AST Parser` is a Python library for parsing and interpreting `CEDARScript`, a SQL-like language designed for concise code analysis, manipulation, and refactoring tasks.

## What is CEDARScript?

[CEDARScript](https://bit.ly/cedarscript) (_Concise Examination, Development, And Refactoring Script_) is a domain-specific language that
aims to improve how AI coding assistants interact with codebases and communicate their code modification intentions.
It provides a standardized way to express complex code modification and analysis operations, making it easier for 
AI-assisted development tools to understand and execute these tasks.

## Features

- Parse `CEDARScript` Abstract Syntax Tree (`AST`) that was generated by Tree-Sitter into a list of commands
- Support for various code manipulation and analysis commands (CREATE, UPDATE, RM, MV, SELECT)
- Return results in `XML` format for easier parsing and processing by LLM systems

## Installation

You can install CEDARScript Parser using pip:

```
pip install cedarscript-ast-parser
```

## Usage

Here's a quick example of how to use CEDARScript Parser:

```python
from cedarscript_ast_parser import CEDARScriptASTParser

parser = CEDARScriptASTParser()
code = """
CREATE FILE "example.py"
UPDATE FILE "example.py"
    INSERT AT END OF FILE
        CONTENT
            print("Hello, World!")
        END CONTENT
END UPDATE
"""

commands, errors = parser.parse_script(code)

if errors:
    for error in errors:
        print(f"Error: {error}")
else:
    for command in commands:
        print(f"Parsed command: {command}")
```

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

## License

This project is licensed under the MIT License.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "cedarscript-ast-parser",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "parser, ast, cedarscript, code-editing, refactoring, code-analysis, sql-like, ai-assisted-development",
    "author": null,
    "author_email": "Elifarley <cedarscript@orgecc.com>",
    "download_url": "https://files.pythonhosted.org/packages/e9/90/0e4e0534ab4f5eee7ec2f4f563d58f1f8e9e5caa6bd4cf51c501aa650235/cedarscript_ast_parser-0.7.0.tar.gz",
    "platform": null,
    "description": "# CEDARScript AST Parser\n\n[![PyPI version](https://badge.fury.io/py/cedarscript-ast-parser.svg)](https://pypi.org/project/cedarscript-ast-parser/)\n[![Python Versions](https://img.shields.io/pypi/pyversions/cedarscript-ast-parser.svg)](https://pypi.org/project/cedarscript-ast-parser/)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)\n\n`CEDARScript AST Parser` is a Python library for parsing and interpreting `CEDARScript`, a SQL-like language designed for concise code analysis, manipulation, and refactoring tasks.\n\n## What is CEDARScript?\n\n[CEDARScript](https://bit.ly/cedarscript) (_Concise Examination, Development, And Refactoring Script_) is a domain-specific language that\naims to improve how AI coding assistants interact with codebases and communicate their code modification intentions.\nIt provides a standardized way to express complex code modification and analysis operations, making it easier for \nAI-assisted development tools to understand and execute these tasks.\n\n## Features\n\n- Parse `CEDARScript` Abstract Syntax Tree (`AST`) that was generated by Tree-Sitter into a list of commands\n- Support for various code manipulation and analysis commands (CREATE, UPDATE, RM, MV, SELECT)\n- Return results in `XML` format for easier parsing and processing by LLM systems\n\n## Installation\n\nYou can install CEDARScript Parser using pip:\n\n```\npip install cedarscript-ast-parser\n```\n\n## Usage\n\nHere's a quick example of how to use CEDARScript Parser:\n\n```python\nfrom cedarscript_ast_parser import CEDARScriptASTParser\n\nparser = CEDARScriptASTParser()\ncode = \"\"\"\nCREATE FILE \"example.py\"\nUPDATE FILE \"example.py\"\n    INSERT AT END OF FILE\n        CONTENT\n            print(\"Hello, World!\")\n        END CONTENT\nEND UPDATE\n\"\"\"\n\ncommands, errors = parser.parse_script(code)\n\nif errors:\n    for error in errors:\n        print(f\"Error: {error}\")\nelse:\n    for command in commands:\n        print(f\"Parsed command: {command}\")\n```\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nThis project is licensed under the MIT License.\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "A library for parsing and interpreting CEDARScript, a SQL-like language for code analysis and transformations",
    "version": "0.7.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/CEDARScript/cedarscript-ast-parser-python/issues",
        "Documentation": "https://github.com/CEDARScript/cedarscript-ast-parser-python#readme",
        "Homepage": "https://github.com/CEDARScript/cedarscript-ast-parser-python",
        "Repository": "https://github.com/CEDARScript/cedarscript-ast-parser-python.git"
    },
    "split_keywords": [
        "parser",
        " ast",
        " cedarscript",
        " code-editing",
        " refactoring",
        " code-analysis",
        " sql-like",
        " ai-assisted-development"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "825f3adda74f4837359986a51aa50287aa44e917da3f89dde7aed3b447e22aba",
                "md5": "2bd5cd5023b0c2a0c33eb853c12765b0",
                "sha256": "776d0dd67fefa7b120fa59d0b3a68af50835830b92a12e99c9bcc90555fbdd1d"
            },
            "downloads": -1,
            "filename": "cedarscript_ast_parser-0.7.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2bd5cd5023b0c2a0c33eb853c12765b0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 15339,
            "upload_time": "2024-12-12T06:32:41",
            "upload_time_iso_8601": "2024-12-12T06:32:41.363490Z",
            "url": "https://files.pythonhosted.org/packages/82/5f/3adda74f4837359986a51aa50287aa44e917da3f89dde7aed3b447e22aba/cedarscript_ast_parser-0.7.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e9900e4e0534ab4f5eee7ec2f4f563d58f1f8e9e5caa6bd4cf51c501aa650235",
                "md5": "24216e3188db00ed5fb2ee46d0f4822a",
                "sha256": "faa247376c884d6b7b9bb5d259344b9d5b33077a0a3dcecc4bb2b98cf0d7a837"
            },
            "downloads": -1,
            "filename": "cedarscript_ast_parser-0.7.0.tar.gz",
            "has_sig": false,
            "md5_digest": "24216e3188db00ed5fb2ee46d0f4822a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 18721,
            "upload_time": "2024-12-12T06:32:43",
            "upload_time_iso_8601": "2024-12-12T06:32:43.596422Z",
            "url": "https://files.pythonhosted.org/packages/e9/90/0e4e0534ab4f5eee7ec2f4f563d58f1f8e9e5caa6bd4cf51c501aa650235/cedarscript_ast_parser-0.7.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-12 06:32:43",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "CEDARScript",
    "github_project": "cedarscript-ast-parser-python",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "cedarscript-ast-parser"
}
        
Elapsed time: 0.37326s