Skip to main content

LazyDatabricks ๐Ÿงฑ

A keyboard-first TUI for Databricks โ€” lazygit for your data platform.

Status โ†’ Logs โ†’ Action in seconds, not clicks.

Design Principles

  • Read-first, act-second. Default is safe visibility; destructive actions require explicit arming.
  • Spark-true, not API-true. "Is my cluster usable?" matters more than "does the API say RUNNING?"
  • Logs are the primary artifact. One keystroke, not seven clicks.

Quick Start

# Install
pip install lazydatabricks

# Or from source
pip install -e ".[dev]"

# Configure (uses same env vars / .databrickscfg as Databricks SDK)
export DATABRICKS_HOST=https://adb-xxx.azuredatabricks.net
export DATABRICKS_TOKEN=dapi...

# Launch TUI (default)
lazydatabricks

# Or use specific profile
lazydatabricks --profile staging

# CLI mode (non-interactive)
lazydatabricks health      # Health snapshot
lazydatabricks clusters    # List clusters
lazydatabricks jobs        # List jobs
lazydatabricks test        # Test connection

TUI Overview

LazyDatabricks provides a keyboard-driven interface with five main screens:

  • Home (h) โ€” Health dashboard showing workspace identity, Spark connectivity, cluster/job/warehouse summaries
  • Clusters (c) โ€” List and manage compute clusters with start/terminate/restart actions
  • Jobs (j) โ€” Three-pane hierarchy: Jobs โ†’ Runs โ†’ Detail with run now/cancel/rerun actions
  • Warehouses (w) โ€” SQL warehouse management with start/stop actions
  • Config โ€” Profile switching and connection testing

Safety Model: Armed Mode

LazyDatabricks defaults to READ-ONLY mode. All destructive actions require explicitly arming:

  1. Press A to arm (30-second timer starts)
  2. Header shows red "ARMED (Xs)" countdown
  3. Execute destructive action (e.g., t to terminate cluster)
  4. System auto-disarms after 30 seconds

Destructive actions include:

  • Cluster: start, terminate, restart
  • Job: run now, cancel, rerun
  • Warehouse: start, stop

Keybindings

Global Navigation

Key Action
h Home screen
c Clusters screen
j Jobs screen
w Warehouses screen
A Toggle armed mode (30s)
? Show help overlay
q Quit
Esc Back / Close modal

Home Screen

Key Action
r Refresh health data

Clusters Screen

Key Action
s Start cluster (requires armed)
t Terminate cluster (requires armed)
R Restart cluster (requires armed)
l View cluster logs (opens browser)
r Refresh
Enter Open in Databricks UI

Jobs Screen

Key Action
Tab Switch between panes (Jobs โ†’ Runs โ†’ Detail)
Enter Drill down into selection
Esc Back up in hierarchy
n Run job now (requires armed)
c Cancel run (requires armed)
R Rerun (requires armed)
l View run logs
r Refresh

Logs Screen

Key Action
/ Start search
n Next search match
N Previous search match
f Cycle filter (ALL โ†’ ERROR โ†’ WARN+ โ†’ INFO+)
G Go to bottom
g Go to top
o Open in browser (fallback)
Esc Close logs

Warehouses Screen

Key Action
s Start warehouse (requires armed)
S Stop warehouse (requires armed)
r Refresh
Enter Open in Databricks UI

Config Screen

Key Action
Enter Switch to selected profile
t Test connection

Architecture

src/lazydatabricks/
โ”œโ”€โ”€ models/       # Data models โ€” stable internal structs
โ”‚   โ”œโ”€โ”€ cluster.py    # ClusterSummary, ClusterState, ClusterFlag
โ”‚   โ”œโ”€โ”€ job.py        # JobSummary, RunSummary, RunDetail
โ”‚   โ”œโ”€โ”€ warehouse.py  # WarehouseSummary, WarehouseState
โ”‚   โ”œโ”€โ”€ health.py     # HealthSnapshot, SparkStatus
โ”‚   โ””โ”€โ”€ config.py     # LazyDatabricksConfig, DatabricksProfile
โ”œโ”€โ”€ api/          # API client layer
โ”‚   โ”œโ”€โ”€ client.py     # DatabricksClient (SDK wrapper)
โ”‚   โ”œโ”€โ”€ clusters.py   # ClusterOps
โ”‚   โ”œโ”€โ”€ jobs.py       # JobOps
โ”‚   โ”œโ”€โ”€ warehouses.py # WarehouseOps
โ”‚   โ”œโ”€โ”€ health.py     # HealthBuilder
โ”‚   โ”œโ”€โ”€ logs.py       # LogOps
โ”‚   โ””โ”€โ”€ guard.py      # ArmedGuard (safety model)
โ””โ”€โ”€ tui/          # Textual TUI
    โ”œโ”€โ”€ app.py        # LazyDatabricksApp main class
    โ”œโ”€โ”€ theme.py      # Colors and CSS
    โ”œโ”€โ”€ screens/      # Screen implementations
    โ”‚   โ”œโ”€โ”€ home.py
    โ”‚   โ”œโ”€โ”€ clusters.py
    โ”‚   โ”œโ”€โ”€ jobs.py
    โ”‚   โ”œโ”€โ”€ logs.py
    โ”‚   โ”œโ”€โ”€ warehouses.py
    โ”‚   โ””โ”€โ”€ config.py
    โ””โ”€โ”€ widgets/      # Reusable widgets
        โ”œโ”€โ”€ header.py
        โ”œโ”€โ”€ status_bar.py
        โ”œโ”€โ”€ help_overlay.py
        โ””โ”€โ”€ confirm_dialog.py

Configuration

LazyDatabricks uses the same configuration as the Databricks SDK:

  1. Environment variables (highest priority)

    export DATABRICKS_HOST=https://adb-xxx.azuredatabricks.net
    export DATABRICKS_TOKEN=dapi...
    export DATABRICKS_CLUSTER_ID=0123-456789-abcdef  # optional
    
  2. ~/.databrickscfg profiles

    [DEFAULT]
    host = https://adb-xxx.azuredatabricks.net
    token = dapi...
    cluster_id = 0123-456789-abcdef
    
    [staging]
    host = https://adb-yyy.azuredatabricks.net
    token = dapi...
    
  3. CLI flags

    lazydatabricks --host https://... --token dapi... --cluster-id 0123...
    lazydatabricks --profile staging
    

Development

# Install with dev dependencies
pip install -e ".[dev]"

# Run tests
pytest tests/ -v

# Type checking
mypy src/lazydatabricks

# Linting
ruff check src/lazydatabricks

Requirements

  • Python 3.10+
  • Databricks workspace with API access

License

MIT

Download files

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

Source Distribution

lazydatabricks-1.0.0.tar.gz (74.5 kB view details)

Uploaded Source

Built Distribution

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

lazydatabricks-1.0.0-py3-none-any.whl (87.1 kB view details)

Uploaded Python 3

File details

Details for the file lazydatabricks-1.0.0.tar.gz.

File metadata

  • Download URL: lazydatabricks-1.0.0.tar.gz
  • Upload date:
  • Size: 74.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for lazydatabricks-1.0.0.tar.gz
Algorithm Hash digest
SHA256 8409a088449b6613bf8a34ef9450b4e32f9bb65a6c7706a855650bcb77e01423
MD5 14e6936b4e5df852637696274357a12b
BLAKE2b-256 7ecfd7846974da6a41665a22f14be5e3558198ef42e533b2bcc5838a8613754d

See more details on using hashes here.

File details

Details for the file lazydatabricks-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: lazydatabricks-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 87.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for lazydatabricks-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 646cf7edb146383bf991f22f3770a6cf1f54495dff99fb290c0d8a17381670da
MD5 ab0f61bd01b04337dabdfcd462495de7
BLAKE2b-256 f4630377732e3444de3a969329daddd3d9bca18c3591fed3a4867f95f7b2d296

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 files

Supported by

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