A JSON file data viewer using pure python
- Mac OS
- Windows10
- Ubuntu
This is a JSON file data viewer based on python.
It only uses built-in libraries of python (tkinter, json).
Features:
-
Minimum dependency.
-
Multi-platform (Mac, Windows, Linux).
-
Easy to use.
- Python 3.6.x or higher
$ pip install PyJSONViewer
or download as zip.
If you add this alias settting in your .bashrc
alias pyjsonviewer='python -m pyjsonviewer'
you can use this tool with just typing "pyjsonviewer" in your bash.
- Run pyjsonviewer with -f option and the path to a JSON file:
$ pyjsonviewer -f path_to_json_file/sample.json
- JSON data tree will be shown.
- Run pyjsonviewer
$ pyjsonviewer
-
File->Open and then select json file.
-
JSON data tree will be shown.
You can set initial directory:
$ pyjsonviewer -d path_to_json_file_dir
-
Run pyjsonviewer.py
-
File->"Open from history" and then double click a json file path from the list.
- JSON data tree will be shown.
- Run pyjsonviewer.py with the option -o
$ python pyjsonviewer.py -o path_to_json_file_dir
-
File browser is shown.
-
You can drag and drop a JSON file to the file browser.
-
Expand all items: Tools -> Expand all
-
Collapse all items: Tools -> Collapse all
-
Show version: Help -> About
-
Show github page: Help -> GitHub page
-
Show release note: Help -> Release note
If you are a vim user, you can set this command in your vimrc.
"JSON format
function! JsonFormat()
%!python -m json.tool
endfunction
command! JsonFormat :call JsonFormat()
"JSON viewer
function! JsonViewer()
"%!python -m pyjsonviewer -f % > /dev/null
let filename = expand('%')
let s:job = job_start(
\ ["/bin/sh", "-c", "python -m pyjsonviewer -f".filename],{})
endfunction
command! JsonViewer :call JsonViewer()
When you are editing a json file with vim,
you can open it using PyJSONViewer with
: JSONViewer()
You can also format json file with
: JSONFormat()
If a URL is included in a json file,
you can open it with a browser with double click the URL.
MIT