# 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)
[![AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)
`CEDARScript Editor (Python)` is a [CEDARScript](https://bit.ly/cedarscript) runtime
for interpreting `CEDARScript` scripts and performing code analysis and modification operations on a codebase.
CEDARScript enables offloading _low-level code syntax and structure concerns_, such as indentation and line counting,
from the LLMs.
The CEDARScript runtime _bears the brunt of file editing_ by locating the exact line numbers and characters to change,
which indentation levels to apply to each line and so on, allowing the _CEDARScript commands_ to focus instead on
**higher levels of abstraction**, like identifier names, line markers, relative indentations and positions
(`AFTER`, `BEFORE`, `INSIDE` a function, its `BODY`, at the `TOP` or `BOTTOM` of it...).
It acts as an _intermediary_ between the **LLM** and the **codebase**, handling the low-level details of code
manipulation and allowing the AI to focus on higher-level tasks.
## 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 directory, 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.
Raw data
{
"_id": null,
"home_page": null,
"name": "cedarscript-editor",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": null,
"keywords": "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/9f/97/b23f7ae4756b544770fe2b144b3af67a4004f6bd8861afb2cb6a17f63d66/cedarscript_editor-1.3.5.tar.gz",
"platform": null,
"description": "# CEDARScript Editor (Python)\n\n[![PyPI version](https://badge.fury.io/py/cedarscript-editor.svg)](https://pypi.org/project/cedarscript-editor/)\n[![Python Versions](https://img.shields.io/pypi/pyversions/cedarscript-editor.svg)](https://pypi.org/project/cedarscript-editor/)\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 Editor (Python)` is a [CEDARScript](https://bit.ly/cedarscript) runtime\nfor interpreting `CEDARScript` scripts and performing code analysis and modification operations on a codebase.\n\nCEDARScript enables offloading _low-level code syntax and structure concerns_, such as indentation and line counting,\nfrom the LLMs.\nThe CEDARScript runtime _bears the brunt of file editing_ by locating the exact line numbers and characters to change,\nwhich indentation levels to apply to each line and so on, allowing the _CEDARScript commands_ to focus instead on \n**higher levels of abstraction**, like identifier names, line markers, relative indentations and positions\n(`AFTER`, `BEFORE`, `INSIDE` a function, its `BODY`, at the `TOP` or `BOTTOM` of it...).\n\nIt acts as an _intermediary_ between the **LLM** and the **codebase**, handling the low-level details of code\nmanipulation and allowing the AI to focus on higher-level tasks.\n\n## What is CEDARScript?\n\n[CEDARScript](https://github.com/CEDARScript/cedarscript-grammar#readme) (_Concise Examination, Development, And Refactoring Script_)\nis a domain-specific language that aims to improve how AI coding assistants interact with codebases and communicate\ntheir code modification intentions.\n\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- Given a `CEDARScript` script and a base directory, executes the script commands on files inside the base directory;\n- Return results in `XML` format for easier parsing and processing by LLM systems\n\n## Installation\n\nYou can install `CEDARScript` Editor using pip:\n\n```\npip install cedarscript-editor\n```\n\n## Usage\n\nHere's a quick example of how to use `CEDARScript` Editor:\n\n```python\nfrom cedarscript_editor import CEDARScriptEdior\n\nparser = CEDARScriptEdior()\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 executing CEDARScript, a SQL-like language for code analysis and transformations",
"version": "1.3.5",
"project_urls": {
"Bug Tracker": "https://github.com/CEDARScript/cedarscript-editor-python/issues",
"Documentation": "https://github.com/CEDARScript/cedarscript-editor-python#readme",
"Homepage": "https://github.com/CEDARScript/cedarscript-editor-python",
"Repository": "https://github.com/CEDARScript/cedarscript-editor-python.git"
},
"split_keywords": [
"cedarscript",
" code-editing",
" refactoring",
" code-analysis",
" sql-like",
" ai-assisted-development"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "dc3a4ca85299068524dbc75b30205f3a509981e6887475a435462994c3e0d83e",
"md5": "0fed155f5012b1d38515a3c02bcc385f",
"sha256": "96e14d317fd761f14282ad4f91a2d5a9e132e1eef8a40ac1ba9d3eba88ce41c1"
},
"downloads": -1,
"filename": "cedarscript_editor-1.3.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0fed155f5012b1d38515a3c02bcc385f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 33803,
"upload_time": "2024-12-12T06:56:58",
"upload_time_iso_8601": "2024-12-12T06:56:58.082960Z",
"url": "https://files.pythonhosted.org/packages/dc/3a/4ca85299068524dbc75b30205f3a509981e6887475a435462994c3e0d83e/cedarscript_editor-1.3.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "9f97b23f7ae4756b544770fe2b144b3af67a4004f6bd8861afb2cb6a17f63d66",
"md5": "656a6d71c552e93e8392d0be6243b89a",
"sha256": "205abd2056b1aa3ec4b388bf79c4333f4ef66ce59bb2ac81e0f99127abd14a10"
},
"downloads": -1,
"filename": "cedarscript_editor-1.3.5.tar.gz",
"has_sig": false,
"md5_digest": "656a6d71c552e93e8392d0be6243b89a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 206542,
"upload_time": "2024-12-12T06:57:01",
"upload_time_iso_8601": "2024-12-12T06:57:01.902213Z",
"url": "https://files.pythonhosted.org/packages/9f/97/b23f7ae4756b544770fe2b144b3af67a4004f6bd8861afb2cb6a17f63d66/cedarscript_editor-1.3.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-12 06:57:01",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "CEDARScript",
"github_project": "cedarscript-editor-python",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "cedarscript-editor"
}