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.4.tar.gz (13.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.4-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: viewinline-0.1.4.tar.gz
  • Upload date:
  • Size: 13.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.4.tar.gz
Algorithm Hash digest
SHA256 1aff18e2c64918c9580924813758335efacce729f4bfd2c0cb82281ed083bcd7
MD5 e9ca2a12ff37a7f3372ffcbf13437f88
BLAKE2b-256 4a3fa3dd2b849c59b1f111ff319792af5b8cbf191fc0c5f5cabd75894cc84c64

See more details on using hashes here.

File details

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

File metadata

  • Download URL: viewinline-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 14.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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 416df63be23a73591b095ec8c795c4b0436e12be9e54fd826a1bd879b8aae867
MD5 6ac748095532851b564d25b74aa678c1
BLAKE2b-256 13b8a41535e24d370e4bf6a1e8a11517d8ab6db321a2f09f0998c0160523723e

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