Skip to main content

Quick look geospatial viewer for iTerm2 and ANSI compatible terminals

Project description

viewinline

Downloads PyPI version Python version

Quick-look geospatial viewer for iTerm2.
Displays rasters and vectors directly in the terminal - no GUI, no temporary files.

This tool combines the core display logic of viewtif and viewgeom, but is non-interactive: you can’t zoom, pan, or switch colormaps on the fly. Instead, you control everything through command-line options (e.g. --display, --color-by, --colormap).

It’s designed for iTerm2 on macOS, using its inline image protocol to render a preview.

Installation

Requires Python 3.9 or later.

pip install viewinline

Usage

viewinline path/to/file.tif
viewinline path/to/vector.geojson
viewinline R.tif G.tif B.tif                 # RGB composite
viewinline path/to/multiband.tif --rgb-bands 3,2,1
viewinline path/to/folder --gallery 4x3      # show image gallery (e.g. 4x3 grid)
viewinline data.csv --describe               # show numeric summary for all numeric columns
viewinline data.csv --describe Income        # show numeric summary for one column
viewinline data.csv --hist                   # render histograms for all numeric columns
viewinline data.csv --hist area_km2          # histogram for one column
viewinline data.csv --scatter X Y            # scatter plot

Features

  • Displays rasters and vectors directly in the terminal
  • Works with iTerm2 inline image protocol
  • Non interactive: everything is controlled through command line options

Supported formats

Rasters

  • GeoTIFF (.tif, .tiff)
  • PNG, JPEG (.png, .jpg, .jpeg)
  • Single-band or multi-band composites

Composite inputs

  • You can pass three rasters (e.g. R.tif G.tif B.tif) to create an RGB composite

Vectors

  • GeoJSON (.geojson)
  • Shapefile (.shp, .dbf, .shx)
  • GeoPackage (.gpkg)

CSV

  • Preview file summary (rows, columns, and names)
  • Summary statistics with --describe
  • Show all numeric columns, or specify one (e.g. --describe height)
  • Inline histograms with --hist
  • Show all numeric columns, or specify one (e.g. --hist area_km2)
  • Scatter plots with --scatter X Y

Gallery view

  • Display all images in a folder with --gallery 4x4

Available options

  --display DISPLAY     Resize only the displayed image (0.5=smaller, 2=bigger). Default: auto-fit to terminal.
  --ansi-size ANSI_SIZE
                        ANSI fallback resolution. Try 180x90 or 200x100.
  --band BAND           Band number to display (single raster case). (default: 1)
  --colormap [{viridis,inferno,magma,plasma,cividis,terrain,RdYlGn,coolwarm,Spectral,cubehelix,tab10,turbo}]
                        Apply colormap to single-band rasters or vector coloring. Flag without value  'terrain'.
  --rgb-bands RGB_BANDS
                        Comma-separated band numbers for RGB display (e.g., '3,2,1'). Overrides default 1-3.
  --gallery [GRID]      Display all PNG/JPG/TIF images in a folder as thumbnails (e.g., 5x5 grid).
  --describe [DESCRIBE]
                        Show summary statistics for all numeric columns or specify one column name (similar to pandas.describe).
  --hist [HIST]         Show histograms for all numeric columns or specify one column name.
  --bins BINS           Number of bins for CSV histograms (used with --hist). (default: 20)
  --scatter X Y         Plot scatter of two numeric CSV columns (e.g. --scatter area_km2 year).
  --color-by COLOR_BY   Numeric column to color vector features by (optional).
  --width WIDTH         Line width for vector boundaries (default: 0.7)
  --edgecolor EDGECOLOR
                        Edge color for vector outlines (hex or named color). (default: #F6FF00)
  --layer LAYER         Layer name for GeoPackage or multi-layer files.

ANSI/ASCII color preview

If iTerm2 isn’t available, viewinline will automatically switch to an ANSI/ASCII color preview or save a quick PNG under /tmp/viewinline_preview.png.

This mode works on terminals with ANSI color support and may not display correctly on others.

For compatible terminals, viewinline renders images in a very coarse resolution. This feature is experimental.

License

This project is released under the MIT License © 2025 Keiko Nomura.

If you find this tool useful, please consider supporting or acknowledging the author.

Useful links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

viewinline-0.1.5.tar.gz (14.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

viewinline-0.1.5-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

Details for the file viewinline-0.1.5.tar.gz.

File metadata

  • Download URL: viewinline-0.1.5.tar.gz
  • Upload date:
  • Size: 14.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for viewinline-0.1.5.tar.gz
Algorithm Hash digest
SHA256 edcb368fa4175c892c98af471959eefb3359ef791c46e8ebf5ead303869edd1b
MD5 e1ddfc6675a87ccc32c252f04911262c
BLAKE2b-256 ccd04042e1548b1ee8147bb0f64a4a65daa7e76227b2d8068c58045c6419bce6

See more details on using hashes here.

File details

Details for the file viewinline-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: viewinline-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 15.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for viewinline-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 c1218d4dd908088bd1e90f6a98cd2fc6a18bcfc881ebdb3263c8c0c0cdd98060
MD5 361f33014725bcd887c4e3b37c9dc0c5
BLAKE2b-256 609189566a7e55c308eb69ddfab6e689ccccab67147105ecf0295ebb7bb41672

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page