Skip to main content

spark-cell-runner (Python CLI)

Run Databricks notebook-source .py cells and SQL from the terminal — against Databricks (Databricks Connect) or fully offline on a local Sail Spark pool — with Unity Catalog sync and a local Delta / Iceberg warehouse. This is the pip-installable twin of the Spark Cell Runner VS Code extension; pools, warehouses, and Databricks profiles are shared between the two.

pip install spark-cell-runner

The command is also installed as the short alias scr — same CLI, five fewer characters: scr pool create dev.

Quickstart

# 1. Create and start a local pool (offline engine, ~1s startup, no JVM)
scr pool create dev
scr pool start dev

# 2. Run a Databricks notebook export, cell by cell (scr ... works everywhere)
spark-cell-runner run my_notebook.py --pool dev

# 3. Run SQL
spark-cell-runner sql query.sql --pool dev
echo "SELECT 1" | spark-cell-runner sql - --pool dev

# 4. Mirror Unity Catalog schemas/tables into the local warehouse
spark-cell-runner sync --catalog main --schema sales --mode schema
spark-cell-runner sync --catalog main --mode data --format iceberg --limit 10000

# 5. Explore and preview (JSON / CSV)
spark-cell-runner explore --source local --level tables --pool dev
spark-cell-runner preview ~/.spark-cell-runner/warehouse/dev/demo.db/orders

Open table formats: Delta + Iceberg

The local warehouse supports both open table formats natively (requires pysail >= 0.4):

Delta Iceberg
Write (Python) df.write.format('delta').save(path) df.write.format('iceberg').save(path)
Write (SQL) CREATE TABLE t ... USING delta LOCATION '...' CREATE TABLE t ... USING iceberg LOCATION '...'
Time travel VERSION AS OF 0 / versionAsOf option snapshotId / branch / tag options
On-disk marker _delta_log/ metadata/*.metadata.json

A directory with either marker is a table: the warehouse registry re-registers on-disk tables (both formats) into every new session, the Unity Catalog explorer shows the format per table, and previews auto-detect the format. The sync command and the extension's sparkCellRunner.syncFormat setting choose the local format for UC sync (default delta).

Running on Databricks instead

spark-cell-runner run my_notebook.py --serverless
spark-cell-runner run my_notebook.py --cluster-id 1234-567890 --profile DEFAULT

Requires the databricks-connect extra: pip install "spark-cell-runner[databricks]".

Shared state with the VS Code extension

  • Pools: ~/.spark-cell-runner/pools/<name>.json (create from either side)
  • Warehouses: ~/.spark-cell-runner/warehouse/<pool>/
  • Databricks profiles: ~/.databrickscfg

Notebook magic support

%sql (shown via result.show()), %md (skipped), %python, %pip (reported, not auto-installed), %sh, and %run (reported) are handled; plain Python cells execute against the shared session namespace.

Development

cd python
pip install -e ".[dev]"
pytest tests

MIT License — see the repository for details.

Metadata

Release files for spark-cell-runner 0.7.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for spark-cell-runner 0.7.1
File Size Uploaded Provenance Actions
spark_cell_runner-0.7.1.tar.gz 31.0 kB With provenance Details for spark_cell_runner-0.7.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for spark-cell-runner 0.7.1
File Interpreter ABI Platform Actions
spark_cell_runner-0.7.1-py3-none-any.whl Python 3 none any Details for spark_cell_runner-0.7.1-py3-none-any.whl

Total release size: 64.3 kB

Release files / spark_cell_runner-0.7.1.tar.gz

Download URL spark_cell_runner-0.7.1.tar.gz
Size 31.0 kB
Tags Source
SHA-256 checksum
How to use checksums
62869f8a546cef7476b254428c6f6e7c2a46e79c563840751947040e0a0939f1
BLAKE2b-256 checksum
How to use checksums
96ee47bdde4ee9a8b3856662b3553270814e2bb889b1e51c81912edc24aed1e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.

Transparency log

Release files / spark_cell_runner-0.7.1-py3-none-any.whl

Download URL spark_cell_runner-0.7.1-py3-none-any.whl
Size 33.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
456ce731f9854b7f9cd01348725bc9c2d524098db18547642e4c200efa12247f
BLAKE2b-256 checksum
How to use checksums
c6e06536bc0600a6cd57091ac8840e4bfd27d19218e99c1d614160839b41dcc2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.

Transparency log

Security for spark-cell-runner 0.7.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for spark_cell_runner-0.7.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.7.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page