abhaykatheria / json2tree Goto Github PK
View Code? Open in Web Editor NEWA python package to convert your json to html tree view.
License: MIT License
A python package to convert your json to html tree view.
License: MIT License
I ran pip install json2tree, then I tried to run in the powershell window this command:
python -m json2tree -j -o -t 1.
There are no errors but no output file is generated. Can I please get some input as to how to run this in a powershell window as well as how to call the API from a python script and get a generated HTML file?
Regardless of input, I get this error. Python 3.11.6 on MacOS Sonoma 14.2 (23C64).
$ json2tree -j base.json -o output.html
Traceback (most recent call last):
File "~/folder/bin/json2tree", line 8, in <module>
sys.exit(main())
^^^^^^
File "~/folder/lib/python3.11/site-packages/json2tree/__main__.py", line 62, in main
run(args)
File "~/folder/lib/python3.11/site-packages/json2tree/__main__.py", line 31, in run
html_string = readJSON(args.json, args.theme)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "~/folder/lib/python3.11/site-packages/json2tree/__main__.py", line 18, in readJSON
html_string = html_1.create_html_report(json_data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "~/folder/lib/python3.11/site-packages/json2tree/theme_1/html.py", line 104, in create_html_report
report = report + '\n' + report_dict_to_html(report_dict)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "~/folder/lib/python3.11/site-packages/json2tree/theme_1/html.py", line 95, in report_dict_to_html
html_string = html_string + dict_handler(dict_obj, 0)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "~/folder/lib/python3.11/site-packages/json2tree/theme_1/html.py", line 63, in dict_handler
for k, v in dict_obj.items():
^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'items'
I tried with a base file, containing just:
[{"a":"b"}]
The code needs to be refactored and certain nonuseful functions need to be removed.
Hello,
Is it possible to open the tree to the first level as part of the generation of the html?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.