Skip to main content

CEDARScript AST Parser

PyPI version Python Versions Code style: black AGPL v3

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 (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:

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.

Metadata

Release files for cedarscript-ast-parser 0.7.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cedarscript-ast-parser 0.7.0
File Size Uploaded
cedarscript_ast_parser-0.7.0.tar.gz 18.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cedarscript-ast-parser 0.7.0
File Interpreter ABI Platform
cedarscript_ast_parser-0.7.0-py3-none-any.whl Python 3 none any Details

Total release size: 34.1 kB

Release files / cedarscript_ast_parser-0.7.0.tar.gz

Download URL cedarscript_ast_parser-0.7.0.tar.gz
Size 18.7 kB
Tags Source
SHA-256 checksum
How to use checksums
faa247376c884d6b7b9bb5d259344b9d5b33077a0a3dcecc4bb2b98cf0d7a837
BLAKE2b-256 checksum
How to use checksums
e9900e4e0534ab4f5eee7ec2f4f563d58f1f8e9e5caa6bd4cf51c501aa650235
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.7

Release files / cedarscript_ast_parser-0.7.0-py3-none-any.whl

Download URL cedarscript_ast_parser-0.7.0-py3-none-any.whl
Size 15.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
776d0dd67fefa7b120fa59d0b3a68af50835830b92a12e99c9bcc90555fbdd1d
BLAKE2b-256 checksum
How to use checksums
825f3adda74f4837359986a51aa50287aa44e917da3f89dde7aed3b447e22aba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.7

Release history Release notifications | RSS feed

This release

0.7.0 This release

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.8

2 release files

0.5.6

2 release files

0.5.5

2 release files

0.5.4

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.11

2 release files

0.2.10

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

1 release file

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page