json tree code example
Example 1: what is JSON TREE
{"status": true,"categories": [{"id": 106,"slug": "products","name": "Products","children": [{"id": 95,"slug": "home","name": "Home","children": [],"category_icon_path": "category/icons/XjDLL4HyxSOYwgZWKW2W1FDb7pY2G6nc32Ij20qN.png"},{"id": 96,"slug": "electronics","name": "Electronics ","children": [],"category_icon_path": "category/icons/3IeSKX3HDLeyZvvjALDokTRSzP2qaGCjOdEKdKmK.png"},{"id": 93,"slug": "fragrances","name": "Fragrances","children": [{"id": 102,"slug": "women-perfumes","name": "Women perfumes ","children": [],"category_icon_path": "category/icons/6hKKxFSuXQqwvSpWGKKWcWOzGlx81HegaPEGlqjI.png"},{"id": 101,"slug": "men-perfumes","name": "Men perfumes ","children": [],"category_icon_path": "category/icons/zf52pmngFJmt7VerWvEzUavFsPNWChTKSdXgBreZ.png"}],"category_icon_path": "category/icons/cWMZxsnPo8EAEew1Gxvayfr4nHGYQhdbVETYVFvQ.png"}],"category_icon_path": "category/icons/nay2xcsPPBy1wYJCN6CON7PPKDBCUN62zWo58kY0.png"},{"id": 94,"slug": "services","name": "Services ","children": [],"category_icon_path": "category/icons/kbGaPr1Dg2WHy9S1ln7ldrOjKgKAIAmUTwQiLpya.png"5 items}]}
Example 2: online json viewer
Online JSON beautifier: https://codebeautify.org/jsonviewer
JSON pretty print in Python:
import json
your_json = '["foo", {"bar":["baz", null, 1.0, 2]}]'
parsed = json.loads(your_json)
print(json.dumps(parsed, indent=4, sort_keys=True))