Pangrm /ˈpæn.ɡræm/ — The universal graph model converter Inspired by Pandoc, Pangrm lets you convert graph-based models across diverse formats — reliably, reproducibly, and type-safely.
Pangrm is a Haskell-based library and CLI tool for converting graph models from one format to another.
The name Pangrm stands for Pan (universal) + GRM (GRAph Model), reflecting its core purpose:
Universal graph model conversion.1
Just like Pandoc provides universal document conversion, Pangrm aims to do the same for graph-based modeling formats — such as .dot, .bpmn, .archimate, and more.
- Modeling tools are fragmented.
- Formats are incompatible.
- Round-trip conversion is error-prone.
With Pangrm – The universal graph model converter, graph model processing is intended to become as seamless and versatile as Pandoc made it for documents.
Pangrm provides:
- 🧩 Modular architecture — Easily plug in new formats (cf. How to Add a New Pangrm Format
- ✅ Type safety — Every conversion step is typed and verifiable
- 🔁 Roundtrip capability — Parse → Unify → Render (back and forth)
- 📦 CLI & Library — Use it as a developer or in pipelines
- 🧪 Comprehensive test suite — Roundtrip fidelity and edge-case safety
- 🔗 Inspired by Pandoc2 — Familiar concepts, stricter semantics
Pangrm currently supports parsing and writing the following formats:
| Tag | Format |
|---|---|
dot |
The GraphViz file format |
cql |
Cypher, Neo4j's declarative query language |
puml |
The PlantUML file format |
mxg |
The MXGraph file format |
amx |
The OpenGroup ArchiMate Model Exchange file format |
ldif |
The SAP LeanIX LeanIX Data Interchange file format |
bpmn |
The OMG Business Process Model and Notation file format |
archimate |
The ArchiMate Tool proprietary file format |
More formats can be added via a clean extension mechanism.
[Reader] [Writer]
Text Text
↓ ↑
[inject] [render]
↓ ↑
AST Format AST Format
↓ ↑
[unify] [eject]
↓ ↑
[Graph as unified IR]
Pangrm converts from textual input (→ format-specific AST → unified graph IR → format-specific AST) → textual output ...and back again. Every supported format must implement both a Reader and a Writer interface. In other words, a Pangrm format must adhere to its defining property: it must be normalizable — i.e., both readable and writable.
You'll need GHC and Cabal.
git clone https://github.com/normenmueller/pangrm.git
cd ./pangrmmakeThis will:
- Clean old builds
- Build the core lib (
pangrm) and CLI (pangrm-cli) - Run tests
- Install both via Cabal
cabal update
cabal cleanThen:
cd lib/
cabal build --enable-tests
cabal test
cabal install
cd ../cli/
cabal build --enable-tests
cabal test
cabal install✅ Pangrm is now ready to use!
Pangrm consists of two components:
pangrm-lib— the core graph modeling librarypangrm-cli— the CLI tool
Example:
pangrm --from ldif --to cql --input example.ldif --output example.cqlTo see all options:
pangrm --helpWe welcome contributions!
-
Follow idiomatic Haskell style & run
hlint -
Write tests for new features Before submitting:
cabal test --enable-tests -
Document public interfaces
-
Prefer total functions and safe types
-
Work on feature branches and open PRs when ready.
Protected
trunkbranchThe
trunkbranch is protected:
- No one (not even maintainers) can push directly to
trunk.- All changes must go through a Pull Request (PR) with at least one review.
- Only squash merges are allowed to ensure a linear, clean commit history.
- Force-push and branch deletion are blocked.
This guarantees stability, traceability, and a clear audit trail for all changes.
To add a new format:
- Define your format
- Implement your format specific
ReaderandWriter - Register your format in the Pangrm registry
- Test your format normalization
See extending Pangrm for details.
Q: Is Pangrm a GUI modeling tool?
A: No. Pangrm is a backend tool. Think of it like Pandoc, but for graph models.
Q: Can Pangrm handle lossy formats like images or SVG?
A: No, Pangrm is about structural conversion of graph models — not visual layout fidelity.
Q: How does Pangrm ensure roundtrip safety?
A: By relying on the "normalizable" nature of Pangrm formats — each format is both readable and writable, enabling safe roundtrips.
Made with ❤️ in Haskell.
Footnotes
-
Also cf. Pangrm Terminology ↩
-
Pangrm owes significant conceptual inspiration to Pandoc, particularly its modular format architecture, reader/writer abstraction, and normalized intermediate representation. Sincere thanks to John MacFarlane and contributors for their foundational work. ↩