Skip to content
Taku edited this page Jun 2, 2023 · 11 revisions

Welcome to the PyViewer wiki!

Introduction

This is a CUI/TUI tool to view any kind of packaged, archived, or binary files made by Python.

Usage

usage: pyviewer [-h]
                [-t {hdf5,pickle,numpy,np_pickle,tar,zip,sqlite3,raw_image,jupyter,xpm}]
                [-iv IMAGE_VIEWER] [--encoding ENCODING] [--ask_password]
                [-v | -k [KEY ...] | -i | -c]
                file

show the constitution of a file. support file types ... hdf5, pickle, numpy,
np_pickle, tar, zip, sqlite3, raw_image, jupyter, xpm

positional arguments:
  file                  input file / "pyviewer update" will update this file

options:
  -h, --help            show this help message and exit
  -t {hdf5,pickle,numpy,np_pickle,tar,zip,sqlite3,raw_image,jupyter,xpm}, --type {hdf5,pickle,numpy,np_pickle,tar,zip,sqlite3,raw_image,jupyter,xpm}
                        file type
  -iv IMAGE_VIEWER, --image_viewer IMAGE_VIEWER
                        set image viewer. supported args are 'matplotlib' (use
                        matplotlib.pyplot.imshow), 'PIL' (use PIL.Image.show),
                        'OpenCV' (use cv2.imshow), and other string is treated
                        as an external command (e.g. gosr, open).
  --encoding ENCODING   specify the encoding format in pickle and zip file.
  --ask_password, -p    ask for the password for the file if needed.
  -v, --verbose         show details
  -k [KEY ...], --key [KEY ...]
                        Dictionary key name in a pickle, path to a
                        Group/Dataset in hdf5, a path to a file/dictionary in
                        tar/zip, a table[/column[,column2...]] in sqlite3 or a
                        key name in npz. If no key is specified, return the
                        list of keys.
  -i, --interactive     open a file with interactive mode. support pickle,
                        hdf5, tar, zip, sqlite3, np_pickle.
  -c, --interactive_cui
                        open a file with interactive CUI mode. support pickle,
                        hdf5, tar, zip, sqlite3, np_pickle.

Requirements

The basic process of this software is designed to work with standard libraries of recent Python 3.
To show some kinds of files, external libraries are required.

e.g.)

The following libraries are not always necessary but are useful if available.

To show images, some imaging-related libraries (e.g. PIL (Pillow), matplotlib or OpenCV) or shell commands (e.g. "open" in macOS) are required.

Installation

I have a one-line installer.

curl https://raw.githubusercontent.com/MeF0504/pyviewer/main/installer.py | python

or in Windows OS,

curl.exe https://raw.githubusercontent.com/MeF0504/pyviewer/main/installer.py | python

By default, this script installs the PyViewer repository in ~/.config/pyviewer/src. If you want to specify the install path, please do

python -c "$(curl https://raw.githubusercontent.com/MeF0504/pyviewer/main/installer.py)" path/to/install
Clone this wiki locally