https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuuJVe1KTAVhxlHWVpUkxpTdKUVvPlqHz2iwTgTITUUVr7lR_NZCwc4WClamlMAZZLWC2swUOmfBbHxegnyCrq8kjb0AnkbkK0SWn-HR6rY8zswnGJ3bHmrNnhoN7p2pVWNCa4n0BVrA8/s800/twyg-logo.png

twyg (PyPI) is a JSON tree data visualizer, written in Python 2 by John Novak, currently 0.1.0 (2014-03-19).

It can render a JSON data into PNG, PDF, SVG, or PostScript using Cairo. Two rendering backends, Cairo and NodeBox1. 16 builtin great configurations with 32 colorschems, and you can extend by yourself with custom human-readable configuration language.

Here is a quick example of default settings:

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjO4cJepsRBnwJX0RshuK7UOom4CALLCo9fWJKM-kUBbZcQEDgrbCNlNb0YlxYvucxWqd-UIsXGYfDkntF7bM0jdoeK4trMmuym-zo6cYLFjnfQXuV7tg8vU1uGuy9VWHY2MV2IhMSeYTs/s800/twyg-example.png

twyg twyg-example.json twyg-example-bubbles-tron.png

Same JSON, change configuration to bubbles:

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUN3CxKZdNuOYfDpQgCueRZCiBHRYtBxP-90Mzj-4NT917vocAU7NEsjtHdwYwSkoj3RyUteIz_JE9SXhXdqTjSvV3R8pTpPuUhigen0S84pl8gqGhwjZRTDMKLyNo7xJpsNtqTCF2glg/s800/twyg-example-bubbles.png

twyg -c bubbles twyg-example.json twyg-example-bubbles.png

Change colorscheme to inca:

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZzq01aKFroxSbs9p2bgouEPCK_GRVtfIg-iWPulNIi_Prr2af7cjRI0rXMhYKJEBppKRAxVMXkig-qvIsXMaXma71_n2iT8MHbyK0b1yR46alUINTkgkEyGvZWkKR39xejdOjktwY3as/s800/twyg-example-bubbles-inca.png

twyg -c bubbles -o inca twyg-example.json twyg-example-bubbles-inca.png

Another configuration tron:

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyrSLzOfwVCrVQymgT8R619-jKtjcVnaOq-PFgAK7kqErZ9xchLRF7YMDBCIay29MozsJPzlnz29Gr57OW80R7pszOvp40IRmEL-qMws74rdDyy5ZykdkDAO5eroTmuI_f85z80ZQCu5g/s800/twyg-example-bubbles-tron.png

twyg -c tron twyg-example.json twyg-example-tron.png

You can see more examples of the builtin configurations and colorschemes on its website, and it’s documented very well.

Beside the configuration and colorscheme, twyg’s command-line options also provide options for DPI, margin, and scaling. The quality of the output is really one catching my eyes and you don’t even need to change anything, just feed into a JSON and you get the quality rendered output file.

Best of all, pip install --user twyg and seconds later, it’s ready to paint a tree.