Skip to main content

PyJSONViewer

A JSON file data viewer using pure python

CI Downloads Downloads Downloads

Gallery

  • Mac OS

img1

  • Windows10

img1

  • Ubuntu

img1

What is this?

This is a JSON file data viewer based on python.

It only uses built-in libraries of python (tkinter, json).

Features:

  1. Minimum dependency.

  2. Multi-platform (Mac, Windows, Linux).

  3. Easy to use.

Requirements

  • Python 3.7 or higher

Download

$ pip install PyJSONViewer

or download as zip.

How to use

Select JSON file with CUI.

  1. Run pyjsonviewer with -f option and the path to a JSON file:

$ pyjsonviewer -f path_to_json_file/sample.json

  1. JSON data tree will be shown.

Select JSON file with GUI.

  1. Run pyjsonviewer

$ pyjsonviewer

  1. File->Open and then select json file.

  2. JSON data tree will be shown.

You can set initial directory:

$ pyjsonviewer -d path_to_json_file_dir

Select JSON file from history.

  1. Run pyjsonviewer.py

  2. File->"Open from history" and then double click a json file path from the list.

img1

  1. JSON data tree will be shown.

Select JSON file with drag and drop.

  1. Run pyjsonviewer.py with the option -o

$ python pyjsonviewer.py -o path_to_json_file_dir

  1. File browser is shown.

  2. You can drag and drop a JSON file to the file browser.

Menu bar function

  • 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

Inside python code

View json file

import pyjsonviewer

pyjsonviewer.view_data(json_file="dat/list.json")

JSON data tree will be shown.

View json object

import pyjsonviewer
json_object = {"a":[1,2,3], "b":"test"}
pyjsonviewer.view_data(json_data=json_object)

JSON data tree will be shown.

Vimrc setting

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()

Open a link with a browser

If a URL is included in a json file,

you can open it with a browser with double click the URL.

License

MIT

Author

Metadata

Release files for PyJSONViewer 1.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for PyJSONViewer 1.6.0
File Size Uploaded
PyJSONViewer-1.6.0.tar.gz 47.6 kB Details

Release files / PyJSONViewer-1.6.0.tar.gz

Download URL PyJSONViewer-1.6.0.tar.gz
Size 47.6 kB
Tags Source
SHA-256 checksum
How to use checksums
cb8b07b20a1e17d87eec1ce7abe5560bdbc70ca1a030f0e81818ee2dae19cfed
BLAKE2b-256 checksum
How to use checksums
7e53f5f2f829ac00a2586c834b7a9c306a6cd59a5bf3392f1c38fc1f9e5d6aaf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1

Release history Release notifications | RSS feed

This release

1.6.0 This release

1 release file

1.5.2

1 release file

1.5.1

1 release file

1.5.0

1 release file

1.4.4

1 release file

1.4.3

1 release file

1.4.1

1 release file

1.4.0

1 release file

1.3.3

1 release file

1.3.2

1 release file

1.3.1

1 release file

1.3.0

1 release file

1.2.0

1 release file

1.1.0

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page