Skip to main content

PySpark-like DataFrame API in Rust (Polars backend), with Python bindings via PyO3

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

robin-sparkless (Python)

PyPI version Python 3.8+ License: MIT Documentation Source

PySpark-style DataFrames in Python—no JVM. Uses Polars under the hood for fast execution.

Install

pip install robin-sparkless

Requirements: Python 3.8+

Quick start

import robin_sparkless as rs

spark = rs.SparkSession.builder().app_name("demo").get_or_create()
df = spark.create_dataframe(
    [(1, 25, "Alice"), (2, 30, "Bob"), (3, 35, "Charlie")],
    ["id", "age", "name"],
)
filtered = df.filter(rs.col("age").gt(rs.lit(26)))
print(filtered.collect())
# [{"id": 2, "age": 30, "name": "Bob"}, {"id": 3, "age": 35, "name": "Charlie"}]

Read from files:

df = spark.read_csv("data.csv")
df = spark.read_parquet("data.parquet")
df = spark.read_json("data.json")

Filter, select, group, join, and use window functions with a PySpark-like API. See the full documentation for details.

Optional features (install from source)

Building from source requires Rust and maturin. Clone the repo, then:

pip install maturin
maturin develop --features pyo3           # default: DataFrame API
maturin develop --features "pyo3,sql"      # spark.sql() and temp views
maturin develop --features "pyo3,delta"    # read_delta / write_delta
maturin develop --features "pyo3,sql,delta" # all optional features

Type checking

The package ships with PEP 561 type stubs (robin_sparkless.pyi). Use mypy, pyright, or another checker:

pip install robin-sparkless mypy
mypy your_script.py

For Python 3.8 compatibility, use mypy <1.10 (newer mypy drops support for python_version = "3.8" in config). The project’s pyproject.toml includes [tool.mypy] and [tool.ruff] with target-version / python_version set for 3.8.

Development

From a clone of the repo:

# Full CI-like check (Rust + Python lint + Python tests)
make check-full

Or step by step:

python -m venv .venv
source .venv/bin/activate   # or .venv\Scripts\activate on Windows
pip install maturin pytest
maturin develop --features "pyo3,sql,delta"
pytest tests/python/ -v

Python lint and type-check (run by make check-full):

pip install ruff 'mypy>=1.4,<1.10'
ruff format --check .
ruff check .
mypy .

CI uses the same tooling: ruff, mypy<1.10 (Python 3.8), and pytest. PySpark is not required for tests (parity expectations are predetermined).

Links

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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

robin_sparkless-0.3.1-cp38-abi3-win_arm64.whl (14.4 MB view details)

Uploaded CPython 3.8+Windows ARM64

robin_sparkless-0.3.1-cp38-abi3-win_amd64.whl (16.0 MB view details)

Uploaded CPython 3.8+Windows x86-64

robin_sparkless-0.3.1-cp38-abi3-musllinux_1_2_x86_64.whl (15.0 MB view details)

Uploaded CPython 3.8+musllinux: musl 1.2+ x86-64

robin_sparkless-0.3.1-cp38-abi3-musllinux_1_2_aarch64.whl (13.7 MB view details)

Uploaded CPython 3.8+musllinux: musl 1.2+ ARM64

robin_sparkless-0.3.1-cp38-abi3-manylinux_2_28_aarch64.whl (14.0 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.28+ ARM64

robin_sparkless-0.3.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (15.0 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ x86-64

robin_sparkless-0.3.1-cp38-abi3-macosx_11_0_arm64.whl (15.8 MB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

robin_sparkless-0.3.1-cp38-abi3-macosx_10_12_x86_64.whl (16.7 MB view details)

Uploaded CPython 3.8+macOS 10.12+ x86-64

File details

Details for the file robin_sparkless-0.3.1-cp38-abi3-win_arm64.whl.

File metadata

File hashes

Hashes for robin_sparkless-0.3.1-cp38-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 100cfc6750667cb2b516d715d81c89e5d808024288553fedef9980110e4c6240
MD5 c01ab1ad27288da90dc3a77bc04820b5
BLAKE2b-256 8f9c2ac36726d086454165718cc899f3b2f821ac5886a9213960758afcfa81e7

See more details on using hashes here.

File details

Details for the file robin_sparkless-0.3.1-cp38-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for robin_sparkless-0.3.1-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 498496cf01af55e1326f40dfa4e294c7576159796fe3b78fd6263e4ade959a27
MD5 3400f115fb73eb016d950f59e34ba977
BLAKE2b-256 192712faa7b8d66b03daa36cc86f3e09e7010db43e4c939357bfa6167dca93f7

See more details on using hashes here.

File details

Details for the file robin_sparkless-0.3.1-cp38-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for robin_sparkless-0.3.1-cp38-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 0d4017c33b0262079d17a0bb033419625496df1745e6645c197e9d0dd143a9bc
MD5 9d0df9b2dfc14675a229bff97746ae7d
BLAKE2b-256 a35342ca214c717e540f5eea7114fe788d3fa43c073d1ac80e1945f2ed6d1530

See more details on using hashes here.

File details

Details for the file robin_sparkless-0.3.1-cp38-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for robin_sparkless-0.3.1-cp38-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 d348f3da209f614d30cf571d2e4cb95927fa383ba681ede747cd0ba82039638c
MD5 cc419df43f7c3b354c1f04f3177c3937
BLAKE2b-256 8bffdcdd368fade7f0f83b614a6df8000a540742cd7a871d6058199537879a74

See more details on using hashes here.

File details

Details for the file robin_sparkless-0.3.1-cp38-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for robin_sparkless-0.3.1-cp38-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 e050f90cb407f48dfaac7e81168dd2315d649a4a3babceaa5d3eac8252ddcf8c
MD5 642b27738ca3f13039f56828bdaf8689
BLAKE2b-256 45625ead9d1f3318a904392d7d85a45ef78a69c8c3c93f2e014acf81a8d0d6be

See more details on using hashes here.

File details

Details for the file robin_sparkless-0.3.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for robin_sparkless-0.3.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c5cdfb9b0c219e26cc550c85ffb36da932ffb799ad75882b70775a9b5727fd78
MD5 b3a382d13fdaf89721b0d8b2106cbec5
BLAKE2b-256 2c8d8918793ad1904ae9ed82727b9dd74409bc0040e6cb769338c18a80306d2f

See more details on using hashes here.

File details

Details for the file robin_sparkless-0.3.1-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for robin_sparkless-0.3.1-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 04d727d5ad1590bf205bdfecec4d4e2b513b44b5078415bbd748b68660a14515
MD5 d45c6cb42c1078984481641c18536d2d
BLAKE2b-256 e5259370caa8f5e0679fe20102f1c3922ff3776ee6c779b00c547a8939ad2e5b

See more details on using hashes here.

File details

Details for the file robin_sparkless-0.3.1-cp38-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for robin_sparkless-0.3.1-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 8f3925881cf5b7e2ffe8f1ea050ec5706d3d1a882ae385653c04e2132d4701e2
MD5 ad5d4b55d685ef9b03b016c433a7fc8f
BLAKE2b-256 e1f7765a61b82fb49161233d3208bf4585c87aa9621494c7e8bfb5acb95c1918

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