Skip to main content

A terminal UI for browsing and querying Delta/Parquet tables with Spark

Project description

spark-viewer-tui

A terminal UI for browsing and querying Delta Lake and Parquet tables with Apache Spark.

Built with Textual and PySpark.

Features

  • Catalog Browser - Sidebar tree with databases and tables
  • SQL Editor - Write and execute Spark SQL queries with syntax highlighting
  • Results Table - View query results with column types and row count
  • Scan Paths - Auto-register Delta/Parquet folders as Spark tables
  • Rescan - Refresh tables on demand (folders are live, Ctrl+S rescans)
  • Save/Load Queries - Persist frequently used queries
  • Themes - Multiple color themes (Transparent, Dracula, Gruvbox)
  • Maximize - Focus on editor or results in full screen

Requirements

  • Python 3.12+
  • Java 17 (for PySpark)

Installation

pip install spark-viewer-tui

Or with uv:

uv pip install spark-viewer-tui

Usage

spark-viewer

Or run directly from source:

uv run python app.py

Keyboard Shortcuts

Key Action
F2 Spark Configuration (metastore, warehouse, scan paths)
F3 Save current query
F4 Load saved query
Ctrl+S Start Spark session / Rescan paths
Ctrl+E Execute SQL query
Ctrl+T Change theme
Ctrl+W Maximize editor or results
Ctrl+C Exit

Getting Started

  1. Run spark-viewer
  2. Press F2 to configure:
    • Metastore DB Path - Where Spark stores metadata (e.g. /tmp/metastore_db)
    • Warehouse Dir Path - Spark warehouse directory (e.g. /tmp/spark-warehouse)
    • Scan Paths - Folders to scan for Delta/Parquet tables
  3. Press Ctrl+S to start the Spark session
  4. Click a table in the sidebar or write SQL in the editor
  5. Press Ctrl+E to run the query

Scan Paths

Scan paths auto-register Delta and Parquet tables from a directory. Each scan path has a database name and a folder path.

db_name: vendas
path:    /data/warehouse

Subfolders are registered as tables:

  • Subfolder with _delta_log/ -> Delta table
  • Subfolder with .parquet files -> Parquet table

Every Ctrl+S drops and recreates the databases from scan paths, keeping tables in sync with the filesystem.

Configuration

Settings are saved in spark_config.json in the project directory:

{
  "metastore_db": "/tmp/metastore_db",
  "warehouse_dir": "/tmp/spark-warehouse",
  "scan_paths": [
    { "path": "/data/warehouse", "db_name": "vendas" },
    { "path": "/data/lake", "db_name": "analytics" }
  ]
}

Project Structure

spark-viewer-tui/
├── app.py              # Main application
├── config.py           # Configuration management
├── spark_manager.py    # Spark session and table registration
├── queries.py          # Query persistence
├── themes.py           # Theme system
├── screens/
│   ├── spark_config.py    # Spark config modal (F2)
│   ├── save_query.py      # Save query modal (F3)
│   ├── load_query.py      # Load query modal (F4)
│   └── theme_selector.py  # Theme selector modal (Ctrl+T)
└── pyproject.toml

License

MIT

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

spark_viewer_tui-0.1.0.tar.gz (36.1 kB view details)

Uploaded Source

Built Distribution

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

spark_viewer_tui-0.1.0-py3-none-any.whl (17.6 kB view details)

Uploaded Python 3

File details

Details for the file spark_viewer_tui-0.1.0.tar.gz.

File metadata

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

File hashes

Hashes for spark_viewer_tui-0.1.0.tar.gz
Algorithm Hash digest
SHA256 df738e88c226712dddb1204160f1adaecf903e9985341bbe55499bc24ca930ea
MD5 ef1d2ed89392a08fd8339fb1ee9f5071
BLAKE2b-256 164ed7cb5faf6e28f39b46a2878bedbde42247de53666de9697e258b1ea3ea0e

See more details on using hashes here.

File details

Details for the file spark_viewer_tui-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for spark_viewer_tui-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 587dc5a854f3827f3178cb1f22c82f2ba6676c0b0240285f69f77e959e8578ea
MD5 81bf97781039ef34073fb678fedbe23b
BLAKE2b-256 5f2bbcbf0521b26a68405ef5a26501d3bfa5f8fc7d32c252d6dbb5459506c2f0

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