Skip to content

A python script, which exports the JSON structure as DOT graph

License

Notifications You must be signed in to change notification settings

N-Schaef/json2dot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

json2dot

A python script, which exports the JSON structure as DOT graph.

This script accepts a JSON string and returns a valid DOT graph script. This can be used to visualize the structure of any given JSON document.

Usage

For example will this command

echo {\"a\":1,\"b\": { \"c\": 2}} | python3 json2dot.py | dot -Tpng -ojson.png

create the following graph

example1

cat json.json | python3 json2dot.py | dot -Tpng -ojson.png

This command will feed the contents of a json file into the script.

The returned DOT code can of course be combined with all DOT preprocessors. If, for example, a JSON object has many members

cat json.json | python3 json2dot.py | unflatten -l 5 | dot -Tpng -ojson.png

can be used to unflatten the graph.

About

A python script, which exports the JSON structure as DOT graph

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages