Raptor flowchart converter and Rapcode interpreter utilities.
Project description
Comet Flowtools
Utilities for working with Raptor flowcharts and Rapcode programs.
Installation
Install from PyPI:
pip install comet-flowtools
Or install from source for development:
git clone <repository-url>
cd comet
pip install -e .
Repository Layout
src/comet_flowtools: High-level API plus modernized utility helpers (formerly the loose scripts insidepython/).src/raptor_converter: Library + CLI for converting.rap/.rapcodefiles into Rapcode, Mermaid, or Graphviz outputs.src/rapcode_interpreter: ANTLR-based interpreter for.rapcodeprograms plus the generated lexer/parser artifacts.tests/fixtures: Minimal.rapinputs that keep the test suite self-contained.tests/unit: Python unit tests that cover the parser/generator stack and the public API.
The duplicate copy of raptor_converter that previously lived inside the interpreter directory has been removed. Both apps now share the same canonical package under src/.
Usage
After installation (from PyPI or source), the following command-line tools are available:
raptor-convert path/to/flowchart.rap --to mermaidrapcode-run path/to/program.rapcodeflowtools export-raptor-ast path/to/flowchart.rap -o flowchart.json
You can also run individual modules directly:
python -m raptor_converter input.rap --to mermaid
python -m rapcode_interpreter program.rapcode
Or use the unified flowtools command with subcommands.
Python API
Installing the project also exposes a comet_flowtools package that unifies
the converter and interpreter capabilities behind a single import surface:
from comet_flowtools import (
parse_raptor_file,
parse_rapcode,
ast_to_rapcode,
convert_raptor_to_rapcode,
run_rapcode,
)
# Parse a .rap XML file into the canonical AST structure.
# Note: Use absolute paths or paths relative to your working directory
program_ast = parse_raptor_file("path/to/flowchart.rap")
# Convert that AST into Rapcode text (and optionally write it to disk).
rapcode_text, _ = convert_raptor_to_rapcode(
"path/to/flowchart.rap",
"output.rapcode",
)
# You can also round-trip an existing .rapcode file or text snippet.
rapcode_ast = parse_rapcode(rapcode_text)
# Execute Rapcode from a string or path and capture its output.
captured = []
run_rapcode('OUTPUT "Hello!"', output_callback=captured.append, source_is_path=False)
assert captured == ["Hello!"]
Every helper returns plain dictionaries or strings so you can integrate the library into other tooling or educational workflows.
Running Tests
python -m unittest discover -s tests -t .
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file comet_flowtools-0.1.0.tar.gz.
File metadata
- Download URL: comet_flowtools-0.1.0.tar.gz
- Upload date:
- Size: 36.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
788fe9ea888d51734659cda7c1e8915178bbcebb33176a7024dbda9bd80230fa
|
|
| MD5 |
7bcc1868f7f144987b1ccd89f11c443d
|
|
| BLAKE2b-256 |
de7fa172855bececa82f240b350c998328e51c5cc65c5dea3b84108b81ac82b5
|
File details
Details for the file comet_flowtools-0.1.0-py3-none-any.whl.
File metadata
- Download URL: comet_flowtools-0.1.0-py3-none-any.whl
- Upload date:
- Size: 45.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
195427bfea9db51a02a989d47ce6ffa5f5198bf1d7413cb119d4a777bc25ede2
|
|
| MD5 |
32a38e59cc7cdd19c77dc0a8f6bfa35b
|
|
| BLAKE2b-256 |
ad2890ff038e0aaf44f040ed08da84a8ade2a10c2cf41d02f5f8240539f4022c
|