Skip to main content

Library for pretty printing json data to txt files

Project description

json2txttree on PyPI https://travis-ci.com/cibinjoseph/json2txttree.svg?branch=master

json2txttree

Python code that converts JSON data to tree-like output for documentation or pretty printing

Usage

import json
from json2txttree import json2txttree

# Load json data
with open('sample.json', 'r') as f:
  jsonData = json.load(f)

# Pretty print json hierarchy as a tree
print(json2txttree(jsonData))

└─  (object)
   ├─ "name" (string)
   ├─ "age" (number)
   ├─ "languages" (array)
     └─  (string)
   ├─ "subjects" (object)
     ├─ "Math" (number)
     └─ "Science" (number)
   └─ "ids" (array)
      └─  (object)
         ├─ "name" (string)
         └─ "number" (string)

0.1.0 (2022-03-18)

  • Initial release.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

json2txttree-1.0.4.tar.gz (3.3 kB view hashes)

Uploaded Source

Built Distribution

json2txttree-1.0.4-py3-none-any.whl (3.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page