Metadata-Version: 2.1
Name: cedarscript_ast_parser
Version: 0.1.0
Summary: A library for parsing and interpreting CEDARScript, a SQL-like language for code analysis and transformations
Author-email: Elifarley <elifarley@example.com>
Project-URL: Homepage, https://github.com/CEDARScript/cedarscript-ast-parser
Project-URL: Documentation, https://github.com/CEDARScript/cedarscript-ast-parser#readme
Project-URL: Repository, https://github.com/CEDARScript/cedarscript-ast-parser.git
Project-URL: Bug Tracker, https://github.com/CEDARScript/cedarscript-ast-parser/issues
Keywords: parser,ast,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.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: tree-sitter>=0.20.1
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"

# CEDARScript Parser

CEDARScript 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 (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 commands (create, delete, move, update)
- SQL-like syntax for intuitive code querying and manipulation
- High-level abstractions for complex refactoring operations
- Language-agnostic design for versatile code analysis
- Reduced token usage via semantic-level code transformations
- Scalable to larger codebases with minimal token usage
- Error handling and reporting for invalid scripts
- 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.
