Metadata-Version: 2.1
Name: json4tree
Version: 1.0.0
Summary: Makes any JSON compatible with D3's hierarchy or tree chart formats (see https://d3js.org)
Home-page: https://github.com/robertjamison/json4tree
Author: Robert G. Jamison
Author-email: info@robertjamison.us
License: MIT License
Project-URL: Bug Tracker, https://github.com/robertjamison/json4tree/issues
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Requires-Python: >=3.0
Description-Content-Type: text/markdown
License-File: LICENSE

# json4tree
Makes any JSON compatible with [D3's hierarchy or tree chart formats](https://d3js.org).

## Installation
Since this tool is exclusively `Python3`, you'll need `pip3` to install:
```
pip3 install json4tree
```
You can also download and install the package directly from [PyPi](https://pypi.org/project/json4tree/0.1.5/).
## Usage
If your `Python3` library is included in your path, try running `json4tree` directly from the command line:

```bash
# if you have your Python3 scripts added to your path, use this one:
json4tree input.json output.json

# otherwise, use this one:
python3 json4tree input.json output.json
```
If you need to import it as a module in your `Python3` script, do it like so:
```python
# import the necessary modules
import json
import json4tree

# import your JSON data
infile = open("input.json", "r")
json_file = json.load(infile)
infile.close()

# create a new handler
converter = json4tree.handler(json_file)

# You can either print your results...
converter.results

# Or you can save your results
outfile = open("output.json", "w")
outfile.write(converter.results)
outfile.close()
```
## Examples
Here is an example [input file](https://github.com/robertjamison/json4tree/sample/input.json) from [Merriam-Webster's Dictionary API](https://www.dictionaryapi.com/products/json) and the resulting [output file](https://github.com/robertjamison/json4tree/sample/output.json).


