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

Quickstart

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

# 2. Run a Databricks notebook export, cell by cell
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.0

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.0
File Size Uploaded Provenance Actions
spark_cell_runner-0.7.0.tar.gz 30.7 kB With provenance Details for spark_cell_runner-0.7.0.tar.gz

Built distribution (wheel)

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

Total release size: 63.7 kB

Release files / spark_cell_runner-0.7.0.tar.gz

Download URL spark_cell_runner-0.7.0.tar.gz
Size 30.7 kB
Tags Source
SHA-256 checksum
How to use checksums
43ab908418e195322c979dc6126aab60fa9ec049552fecb42ce36f961d0a5537
BLAKE2b-256 checksum
How to use checksums
00a80c131284049ce44d47b6f827b85144febafa034effaf614a37b4bae01376
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 15, 2026.

Transparency log

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

Download URL spark_cell_runner-0.7.0-py3-none-any.whl
Size 33.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
520ef33a39def43ce57222bedec64f8bbc6a3193d125dd4f106c26540d41306f
BLAKE2b-256 checksum
How to use checksums
b99859832e3d5734c42cd259289062d0792d0ffb4b3a586d156a2cceb031eb73
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 15, 2026.

Transparency log

Security for spark-cell-runner 0.7.0

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.0.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 15, 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.0 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