Metadata-Version: 2.1
Name: cedarscript-editor
Version: 0.3.1
Summary: A library for executing CEDARScript, a SQL-like language for code analysis and transformations
Author-email: Elifarley <cedarscript@orgecc.com>
License: MIT
Project-URL: Homepage, https://github.com/CEDARScript/cedarscript-editor-python
Project-URL: Documentation, https://github.com/CEDARScript/cedarscript-editor-python#readme
Project-URL: Repository, https://github.com/CEDARScript/cedarscript-editor-python.git
Project-URL: Bug Tracker, https://github.com/CEDARScript/cedarscript-editor-python/issues
Keywords: cedarscript,code-editing,refactoring,code-analysis,sql-like,ai-assisted-development
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Text Processing :: Linguistic
Classifier: Topic :: Software Development :: Code Generators
Classifier: Topic :: Software Development :: Compilers
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: cedarscript-ast-parser>=0.2.6
Requires-Dist: grep-ast==0.3.3
Requires-Dist: tree-sitter-languages==1.10.2
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: black>=22.0; extra == "dev"
Requires-Dist: isort>=5.0; extra == "dev"
Requires-Dist: flake8>=4.0; extra == "dev"
Requires-Dist: mypy>=0.900; extra == "dev"
Requires-Dist: coverage>=6.0; extra == "dev"
Requires-Dist: tox>=3.24; extra == "dev"

# CEDARScript Editor (Python)

[![PyPI version](https://badge.fury.io/py/cedarscript-editor.svg)](https://pypi.org/project/cedarscript-editor/)
[![Python Versions](https://img.shields.io/pypi/pyversions/cedarscript-editor.svg)](https://pypi.org/project/cedarscript-editor/)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

`CEDARScript Editor (Python)` is a Python library for interpreting `CEDARScript` scripts and 
performing code analysis and modification operations on a codebase.

## What is CEDARScript?

[CEDARScript](https://github.com/CEDARScript/cedarscript-grammar#readme) (_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

- Given a `CEDARScript` script and a base direcotry, executes the script commands on files inside the base directory;
- Return results in `XML` format for easier parsing and processing by LLM systems

## Installation

You can install `CEDARScript` Editor using pip:

```
pip install cedarscript_editor
```

## Usage

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

```python
from cedarscript_editor import CEDARScriptEdior

parser = CEDARScriptEdior()
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.
