Skip to content
Taku edited this page Jun 6, 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] | update [update pyviewer] | config_list [show the
                        current optional configuration] | help [show the detailed help
                        of each type]

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}
                        specify the file type. "pyviewer help -t TYPE" will show the
                        detailed help.
  -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.
  --ask_password, -p    ask for the password for the file if needed.
  -v, --verbose         show details
  -k [KEY ...], --key [KEY ...]
                        specify the key name to show. If no key is specified, return the
                        list of keys.
  -i, --interactive     open a file with interactive mode.
  -c, --interactive_cui
                        open a file with interactive CUI mode.

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