Convert JSON Schema (Draft 2020-12) into simple, human-friendly ERD diagrams.
This tool transforms structured JSON Schema definitions into clear entity-relationship diagrams — making them easier to understand for both technical and non-technical users.
- 🔄 Convert JSON Schema → ERD diagram
- 🧠 Simplified visual output (focused on clarity)
- 📦 Supports standard JSON Schema format
- 🎨 Export diagrams as PNG (via Graphviz)
- 🧩 CLI + Python API support
pip install schema-to-erd
⚠️ Requires Graphviz installed:Mac
brew install graphvizUbuntu
sudo apt install graphviz
schema-to-erd --input schema.jsonschema-to-erd --input schema.json --out-file product --format png| Option | Description |
|---|---|
--input |
Path to JSON schema file (required) |
--out-file |
Output file name |
--format |
Output format (default: png) |
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Product",
"type": "object",
"properties": {
"productId": {
"type": "integer"
},
"productName": {
"type": "string"
}
}
}schema-to-erd --input product.schema.json --format pngThe tool generates a diagram with:
-
Entity: Product
-
Attributes:
- productId (integer)
- productName (string)
from schema_to_erd import build_erd_from_schema
build_erd_from_schema(
"product.schema.json",
"product",
"png"
)schema-to-erd --input path/to/product.schema.json👉 Output:
product.png
- JSON Schema
title→ Entity name properties→ Attributes- Nested objects / references → Relationships
git clone https://github.com/khalsz/schema-to-ERD.git
cd schema-to-ERD
pip install -e .pytestMIT License
Contributions are welcome!
- Open issues
- Suggest improvements
- Submit pull requests
Built by Khalsz