Skip to main content
Change of provenance

The repository or configuration that created this release differ from a previous release. View details.

Sparkless

PySpark-compatible DataFrames in Python—no JVM, no cluster.
Drop-in replacement for local development and testing. Same API, 10–100× faster feedback.

Before you adopt: Read caveats — UDF limits, parity gaps, not a Spark cluster replacement.

  • Python 3.8+ · PySpark 3.2–3.5 compatible · MIT

In 30 seconds

# Swap the import—everything else stays the same.
from sparkless.sql import SparkSession, functions as F

spark = SparkSession.builder.app_name("demo").get_or_create()
df = spark.createDataFrame([{"x": 1}, {"x": 2}])
df.filter(F.col("x") > 1).show()
pip install "sparkless>=4,<5"

No Java, no Spark install, no 30-second session startup. Ideal for unit tests and CI.


Why Sparkless?

If you… Sparkless gives you…
Test PySpark code Same SparkSession / DataFrame / Column API; tests run in seconds without a JVM
Run in CI No Java, no Spark distribution, no flaky cluster; just pip install and pytest
Develop locally Fast iteration with Parquet, CSV, JSON, Delta, SQL, temp views—no cluster needed
Need real PySpark sometimes Use sparkless.testing: one test suite, run with sparkless or SPARKLESS_TEST_MODE=pyspark

v4 uses the robin-sparkless Rust engine (Polars under the hood). No Polars Python dependency at runtime—just a small native extension.


Installation

From PyPI (recommended)

pip install "sparkless>=4,<5"

Prebuilt wheels are provided for common platforms (Linux, macOS, Windows).
For development from the robin-sparkless repo:

# From repo root
pip install ./python

Contributors should use the uv setup and native build workflow.

Optional extras

Extra Use case
pip install "sparkless[dev]" pytest, pandas, hypothesis, pytest-xdist
pip install "sparkless[jdbc]" JDBC integration tests (testcontainers, drivers)
pip install "sparkless[pyspark]" Run tests against real PySpark (SPARKLESS_TEST_MODE=pyspark)

Supported platforms

Prebuilt wheels are published for CI targets on each release (see PyPI files):

OS Architectures Notes
Linux x86_64, aarch64 glibc manylinux; musl (Alpine) wheels where available
macOS arm64, x86_64 Universal coverage via separate wheels
Windows x86_64, arm64 Prebuilt extension modules

Python: 3.8, 3.9, 3.10, 3.11, 3.12 (cp38–cp312 ABI tags on wheels).

If no wheel matches your platform, follow the source build instructions.


Quick start

Basic usage

from sparkless.sql import SparkSession, functions as F

spark = SparkSession.builder.app_name("MyApp").get_or_create()
data = [{"name": "Alice", "age": 25}, {"name": "Bob", "age": 30}]
df = spark.createDataFrame(data)

df.filter(F.col("age") > 25).select("name").show()
# +----+
# |name|
# +----+
# | Bob|
# +----+

result = df.filter(F.col("age") > 25).select("name").collect()
# [Row(name='Bob')]

In tests (pytest)

import pytest
from sparkless.sql import SparkSession, functions as F

def test_high_scores():
    spark = SparkSession.builder.app_name("test").get_or_create()
    df = spark.createDataFrame([{"score": 95}, {"score": 87}, {"score": 92}])
    high = df.filter(F.col("score") > 90)
    assert high.count() == 2
    assert high.agg(F.avg("score")).collect()[0][0] == 93.5
    spark.stop()

SQL and temp views

df = spark.createDataFrame([{"name": "Alice", "salary": 50000}, {"name": "Bob", "salary": 60000}])
df.createOrReplaceTempView("employees")

spark.sql("SELECT name, salary FROM employees WHERE salary > 50000").show()

Bounded Arrow export

toArrow() still returns a materialized PyArrow Table. Use toArrowBatches() to stream RecordBatches from the query plan with row and byte limits:

with df.toArrowBatches(max_rows=1024, max_bytes=8 * 1024 * 1024) as batches:
    for batch in batches:
        consume(batch)  # batch is a pyarrow.RecordBatch
        if should_stop():
            break

Each batch stays within both values (max_bytes is checked against RecordBatch.nbytes); if a single row is larger than max_bytes, iteration raises ValueError. The defaults are 10,000 rows and 64 MiB. Close the iterator (or use it as a context manager) after an early stop so the query stops producing batches.

JDBC (PostgreSQL, SQLite, MySQL, etc.)

# Read
url = "jdbc:postgresql://localhost:5432/mydb"
df = spark.read.jdbc(url=url, table="users", properties={"user": "u", "password": "p"})

# Write
df.write.jdbc(url=url, table="users_backup", properties={"user": "u", "password": "p"}, mode="overwrite")

Supported: PostgreSQL, SQLite, MySQL, MariaDB, SQL Server, Oracle, DB2. Same options as PySpark (sessionInitStatement, batchsize, truncate, etc.).


API at a glance

Area Supported
SparkSession builder, createDataFrame, table, sql, range, read_csv / read_parquet / read_json / read_delta, temp/global temp views, catalog, stop
DataFrame filter, select, withColumn, show, collect, toArrow, toArrowBatches, count, groupBy, orderBy, limit, drop, distinct, join, union, unionByName, write, createOrReplaceTempView
Column / functions col, lit, when/then/otherwise, comparison/aggregation/string/window functions; F.col("x") > 1, F.upper("name"), etc.
GroupedData count, sum, avg, min, max, agg, pivot
Read/Write Parquet, CSV, JSON, Delta; saveAsTable; JDBC with standard options

Detailed parity and differences: PYSPARK_DIFFERENCES.md, PARITY_STATUS.md.


Dual-mode testing (sparkless + PySpark)

Use sparkless.testing to run the same tests with the sparkless backend (fast) or real PySpark (parity check).

1. Register the plugin (e.g. in conftest.py):

pytest_plugins = ["sparkless.testing"]

2. Write tests using the spark and optional spark_imports fixtures:

def test_filter(spark):
    df = spark.createDataFrame([{"id": 1}, {"id": 2}])
    assert df.filter(df.id > 1).count() == 1

def test_upper(spark, spark_imports):
    F = spark_imports.F
    df = spark.createDataFrame([{"name": "alice"}])
    assert df.select(F.upper("name")).collect()[0][0] == "ALICE"

3. Run

# Default: sparkless backend (no JVM)
pytest tests/ -v

# Parallel
pytest tests/ -n 12 -v

# Against real PySpark (requires Java + pip install pyspark)
SPARKLESS_TEST_MODE=pyspark pytest tests/ -v

Fixtures: spark, spark_mode, spark_imports, isolated_session, table_prefix
Markers: @pytest.mark.sparkless_only, @pytest.mark.pyspark_only, @pytest.mark.delta
Helpers: assert_dataframes_equal(), compare_dataframes()

Full details: TESTING_GUIDE.md.


Requirements

  • Python 3.8+
  • Sparkless mode: No Java or Spark required.
  • PySpark mode (optional): Java and pip install pyspark for SPARKLESS_TEST_MODE=pyspark.

Development

Follow CONTRIBUTING.md to create the root .venv, install development dependencies with uv, and build the native extension. From the repository root:

# Rebuild after changing Rust or PyO3 code
(
  cd python
  uv run --no-project --python ../.venv/bin/python \
    python -m maturin develop --uv --locked --release
)

# Run a focused test against the rebuilt extension
uv run --no-project --python .venv/bin/python \
  python -m pytest tests/unit/test_external_catalog_provider.py -q

For wheels and PySpark parity runs, see the contributor guide. Rust engine, UDFs, embedding: see the main README and docs.


Limitations

  • UDFs: Use built-in functions and expressions; Python UDFs are not exposed. Rust UDFs are supported in the engine (UDF_GUIDE).
  • Compatibility: Some APIs or behaviors differ from PySpark; see PYSPARK_DIFFERENCES.md.

Optional security hardening

For production or multi-tenant use, set SPARKLESS_HARDENED=1 and/or:

  • SPARKLESS_JDBC_ALLOW_ARBITRARY_SQL=false — disallow arbitrary JDBC SQL; use dbtable only
  • SPARKLESS_FILES_BASE=/path/to/sandbox — confine read/write file paths to that directory

See PYSPARK_DIFFERENCES.md — Security hardening for resource limits and multiprocessing notes.


Version history: v3 vs v4

Sparkless v3 Sparkless v4 (this package)
Backend Polars (Python) robin-sparkless (Rust + Polars)
Repo sparkless robin-sparkless
Install pip install sparkless pip install "sparkless>=4,<5" or pip install ./python
Runtime Polars Python Native extension only; no Polars Python

Same from sparkless.sql import SparkSession in both. v4 is the current major release.


Metadata

Release files for sparkless 4.16.1

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

Change of provenance

The repository or configuration that created these release files differ from that of a previous release.

We recommend inspecting the repository and configuration before proceeding. View details.

Source distribution (sdist)

Source distribution for sparkless 4.16.1
File Size Uploaded Provenance Actions
sparkless-4.16.1.tar.gz 735.1 kB With provenance Details for sparkless-4.16.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for sparkless 4.16.1
File Actions
sparkless-4.16.1-cp38-abi3-win_arm64.whl CPython 3.8 abi3 Windows ARM64 Details for sparkless-4.16.1-cp38-abi3-win_arm64.whl
sparkless-4.16.1-cp38-abi3-win_amd64.whl CPython 3.8 abi3 Windows x86-64 Details for sparkless-4.16.1-cp38-abi3-win_amd64.whl
sparkless-4.16.1-cp38-abi3-musllinux_1_2_x86_64.whl CPython 3.8 abi3 Linux musl 1.2+ x86-64 Details for sparkless-4.16.1-cp38-abi3-musllinux_1_2_x86_64.whl
sparkless-4.16.1-cp38-abi3-musllinux_1_2_aarch64.whl CPython 3.8 abi3 Linux musl 1.2+ ARM64 Details for sparkless-4.16.1-cp38-abi3-musllinux_1_2_aarch64.whl
sparkless-4.16.1-cp38-abi3-manylinux_2_28_aarch64.whl CPython 3.8 abi3 Linux glibc 2.28+ ARM64 Details for sparkless-4.16.1-cp38-abi3-manylinux_2_28_aarch64.whl
sparkless-4.16.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.8 abi3 Linux glibc 2.17+ x86-64 Details for sparkless-4.16.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
sparkless-4.16.1-cp38-abi3-macosx_11_0_arm64.whl CPython 3.8 abi3 macOS 11.0+ ARM64 Details for sparkless-4.16.1-cp38-abi3-macosx_11_0_arm64.whl
sparkless-4.16.1-cp38-abi3-macosx_10_12_x86_64.whl CPython 3.8 abi3 macOS 10.12+ x86-64 Details for sparkless-4.16.1-cp38-abi3-macosx_10_12_x86_64.whl

Total release size: 335.7 MB

Release files / sparkless-4.16.1.tar.gz

Change of provenance

This file belongs to a release with changed provenance: the repository or configuration that created the release files differ from that of a previous release.

We recommend inspecting the repository and configuration before proceeding. View details.

Download URL sparkless-4.16.1.tar.gz
Size 735.1 kB
Tags Source
SHA-256 checksum
How to use checksums
39f7da300f5efc4f4cb21caf268b65d8ecf032e55c4d05373fa461d211169fda
BLAKE2b-256 checksum
How to use checksums
54f194e16cf88e1463e17a53ebf6cb6619e98b9a80a57d8a9993b303ce2f4897
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 25, 2026.

Transparency log

Release files / sparkless-4.16.1-cp38-abi3-win_arm64.whl

Change of provenance

This file belongs to a release with changed provenance: the repository or configuration that created the release files differ from that of a previous release.

We recommend inspecting the repository and configuration before proceeding. View details.

Download URL sparkless-4.16.1-cp38-abi3-win_arm64.whl
Size 40.1 MB
Tags CPython 3.8 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
c572be1de36b281d6c1b8b4a95fc08080afdbb8b4a5dedd66b30cbcd3f19c324
BLAKE2b-256 checksum
How to use checksums
7332388e817d00236ccebb6f09be42ea5c132c7823bcb4b844bc813356bf6ca3
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 25, 2026.

Transparency log

Release files / sparkless-4.16.1-cp38-abi3-win_amd64.whl

Change of provenance

This file belongs to a release with changed provenance: the repository or configuration that created the release files differ from that of a previous release.

We recommend inspecting the repository and configuration before proceeding. View details.

Download URL sparkless-4.16.1-cp38-abi3-win_amd64.whl
Size 43.8 MB
Tags CPython 3.8 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
1c37b9eeb53225566bb381bca675d8cd37af854171fe122abce13e7b8e1314ce
BLAKE2b-256 checksum
How to use checksums
731885b179b83ad4761857b9a557fa28c716160ad78f1f8ecb8d1a992ebd4ecd
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 25, 2026.

Transparency log

Release files / sparkless-4.16.1-cp38-abi3-musllinux_1_2_x86_64.whl

Change of provenance

This file belongs to a release with changed provenance: the repository or configuration that created the release files differ from that of a previous release.

We recommend inspecting the repository and configuration before proceeding. View details.

Download URL sparkless-4.16.1-cp38-abi3-musllinux_1_2_x86_64.whl
Size 41.7 MB
Tags CPython 3.8 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
5d6314aebde185a0eebd474e34340dcbad6f98c72befda75dbb580038a8a4a4b
BLAKE2b-256 checksum
How to use checksums
51f16b28a1616c74b7a8518d1dd7c3015b4290dc59fa0ee59c432d0fabc5bbbe
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 25, 2026.

Transparency log

Release files / sparkless-4.16.1-cp38-abi3-musllinux_1_2_aarch64.whl

Change of provenance

This file belongs to a release with changed provenance: the repository or configuration that created the release files differ from that of a previous release.

We recommend inspecting the repository and configuration before proceeding. View details.

Download URL sparkless-4.16.1-cp38-abi3-musllinux_1_2_aarch64.whl
Size 38.8 MB
Tags CPython 3.8 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
e0b81db3a172128d2ec39b9c942b50efb9180b5fbd60152dc8343a2ca5ba3fc0
BLAKE2b-256 checksum
How to use checksums
53afcc66855d3ec30162e91d042b324b5207a64302bae4ecefaac9bac1227bb5
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 25, 2026.

Transparency log

Release files / sparkless-4.16.1-cp38-abi3-manylinux_2_28_aarch64.whl

Change of provenance

This file belongs to a release with changed provenance: the repository or configuration that created the release files differ from that of a previous release.

We recommend inspecting the repository and configuration before proceeding. View details.

Download URL sparkless-4.16.1-cp38-abi3-manylinux_2_28_aarch64.whl
Size 38.9 MB
Tags CPython 3.8 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
ce9351f99b5b5089ca9b929afd962512e9dd551bacacb03d424fdb748a1832a0
BLAKE2b-256 checksum
How to use checksums
79c97c350d4f11627c1f3d619a86da8aa596b42f77d46192bcc5b18b9d1d66d3
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 25, 2026.

Transparency log

Release files / sparkless-4.16.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Change of provenance

This file belongs to a release with changed provenance: the repository or configuration that created the release files differ from that of a previous release.

We recommend inspecting the repository and configuration before proceeding. View details.

Download URL sparkless-4.16.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 41.7 MB
Tags CPython 3.8 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
886623172f495015c76dd6cb8b104bc2f532334a3f0cba21d69467438a8efe9a
BLAKE2b-256 checksum
How to use checksums
caf30909fce47f75bd708875ed1b25f9b4d901a2a49486ab0379f24d45ddc6c3
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 25, 2026.

Transparency log

Release files / sparkless-4.16.1-cp38-abi3-macosx_11_0_arm64.whl

Change of provenance

This file belongs to a release with changed provenance: the repository or configuration that created the release files differ from that of a previous release.

We recommend inspecting the repository and configuration before proceeding. View details.

Download URL sparkless-4.16.1-cp38-abi3-macosx_11_0_arm64.whl
Size 43.7 MB
Tags CPython 3.8 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
05754da30d2e28157061777db42172a51acd867090845950273f93d19f7d131e
BLAKE2b-256 checksum
How to use checksums
74d42a2aa61670316777f22cbf3b0a5ef41df7f836ced68861d0453e6c3568ba
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 25, 2026.

Transparency log

Release files / sparkless-4.16.1-cp38-abi3-macosx_10_12_x86_64.whl

Change of provenance

This file belongs to a release with changed provenance: the repository or configuration that created the release files differ from that of a previous release.

We recommend inspecting the repository and configuration before proceeding. View details.

Download URL sparkless-4.16.1-cp38-abi3-macosx_10_12_x86_64.whl
Size 46.3 MB
Tags CPython 3.8 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
0a50f19fa52c46e98d635d370e74202e08509a7621b1b7e92d4e23ebd1fd256c
BLAKE2b-256 checksum
How to use checksums
1d038baf7d9c9172484695fa1244202011808b4417b173fecc80b7ec553e2076
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 25, 2026.

Transparency log

Security for sparkless 4.16.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.

Change of provenance

The configuration that created this release differs from a previous release.

While this could reflect a routine change by the project maintainers, it may also indicate that the release files have been compromised.

Select from 9 files

Attestation for sparkless-4.16.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 25, 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
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