gh2ghx is a lightweight macOS-first Tkinter app and Python module for converting Grasshopper .gh files into XML-readable .ghx output.
It prioritizes:
- readable output for XML tooling
- lossless preservation of original binary content
- graceful fallback when native Grasshopper serializers are unavailable
- GUI converter (
.gh->.ghx) with file pickers and status output - macOS Aqua appearance toggle (
aqua/darkaqua) - mode-aware conversion engine with explicit result mode
- regression tests with a real binary Grasshopper fixture
native_ghx- Source is already XML, compressed XML, or native GH deserialization is available (GH_IO/Grasshopper runtime).
binary_structured_report- Raw-deflate binary GH archive detected (
Root+DefinitionObjects). - Produces structured XML report (metadata, components, params, recoverable GUID-like links) and embeds lossless Base64 payload.
- Raw-deflate binary GH archive detected (
xml_wrapper_base64- Generic fallback for unknown binaries.
gh2ghx/
gh2ghx/
app.py
converter.py
theme.py
tests/
fixtures/islamic.gh
test_converter.py
main.py
run_gh2ghx.sh
- Python 3.10+ (3.12 recommended)
- Tkinter (bundled with standard Python installers on macOS)
cd /Users/tsevis/AI/ClaudeCode/gh2ghx
./run_gh2ghx.shOr:
python3 main.pypython3 -m unittest discover -s tests -q- Without native Grasshopper runtime assemblies, binary
.ghfiles cannot always be reconstructed as canonical GHX definitions. - In those cases,
gh2ghxemits a structured XML report with preserved original payload.
MIT. See LICENSE.