Multi-format export generation from parsed GNN models. Pipeline Step 7.
The export module uses a layered design:
processor.py— Orchestrates multi-file and multi-format export workflows (generate_exports,export_single_gnn_file,export_model,export_gnn_model). Includes a built-in GNN content parser (parse_gnn_content).formatters.py— Format-specific serializers that write parsed GNN data to disk. Each function takes a data dict and an outputPath, returningboolfor success.format_exporters.py— Advanced GNN-aware exporters with full section parsing (_gnn_model_to_dict), NetworkX graph construction, and logged output. Functions returnTuple[bool, str].core.py— Pipeline integration adapter invoked by7_export.py.utils.py— Module introspection (get_module_info,get_supported_formats).mcp.py— Model Context Protocol tool registrations.
| Format | Extension | Module | Notes |
|---|---|---|---|
| JSON | .json |
formatters / format_exporters | Human-readable, portable |
| XML | .xml |
formatters / format_exporters | Hierarchical with minidom pretty-print |
| GraphML | .graphml |
formatters / format_exporters | Requires NetworkX (optional) |
| GEXF | .gexf |
formatters / format_exporters | Gephi-compatible, requires NetworkX |
| Pickle | .pkl |
formatters / format_exporters | Python binary serialization |
| Plaintext Summary | .txt |
formatters / format_exporters | Human-readable model summary |
| Plaintext DSL | .dsl |
formatters / format_exporters | Round-trip GNN-like text |
from export import generate_exports, export_single_gnn_file, export_model
from export import get_supported_formats, get_module_info- Required:
json,xml.etree.ElementTree,pickle,pathlib - Optional:
networkx(for GraphML/GEXF graph exports)
uv run uv run --extra dev python -m pytest src/tests/export/test_export_overall.py src/tests/export/test_export_roundtrip.py -v