Skip to main content

A PySpark wrapper that implicitly exposes all PySpark functionality

Project description

Raiju

Documentation Release v0.1.1 PyPI version License: MIT Python 3.9+ CI codecov Discussions Ruff

Docs

PySpark, unleashed. A thin wrapper around PySpark that exposes the full SparkSession API through a single, delegation-based interface, so you get all of Spark’s power with a minimal, extension-ready layer.

  • Full PySpark surface: Every SparkSession API is available through Raiju via delegation. Nothing is reimplemented or locked in; new and future PySpark APIs work automatically.
  • Drop-in entry point: Use Raiju instead of SparkSession. Same builder, same methods, same DataFrames.
  • Works everywhere: Create a new session with the builder or wrap an existing one (e.g. spark in Databricks).
  • Extension-ready: A minimal foundation you can build on without forking PySpark.
  • Single dependency: PySpark 4.0+; no extra runtime deps.

Raiju (雷獣, raijū) is a creature from Japanese folklore: a lightning beast and companion of the thunder god Raijin. The name means “thunder animal”: 雷 (rai, thunder) + 獣 (, beast). This project borrows it because it wraps PySpark, your engine for lightning-fast, distributed data, in a thin, flexible layer. All of Spark’s power is still there; Raiju is the interface that carries it.

Raiju aims to give you one clear entry point for PySpark while staying invisible: same APIs, same types, zero lock-in. You can adopt it gradually (e.g. wrap an existing SparkSession in Databricks) or use it as the base for your own extensions.

Table of Contents

  1. Getting Started
  2. Usage
  3. How It Works
  4. Development
  5. Changelog
  6. Support
  7. Show Your Support
  8. Code of Conduct
  9. Contributing
  10. License
  11. Security

Getting Started

Installation

Raiju is available as raiju on PyPI (or install from source).

Invoke or install with uv (recommended), pip, or pipx:

# With uv.
uv add raiju                    # Add to your project.
uv tool install raiju@latest    # Or install globally.

# With pip.
pip install raiju

# With pipx.
pipx install raiju

From a local clone:

pip install -e .

For development (linting, formatting, tests):

pip install -e ".[dev]"

Requirements: Python 3.9+, PySpark 4.0+.

Usage

Create a session with the builder:

from raiju import Raiju

raiju = Raiju.builder.appName("my_app").master("local[*]").getOrCreate()

Or wrap an existing session (e.g. in Databricks):

from raiju import Raiju

raiju = Raiju(spark)

Use it like PySpark: SQL, DataFrame API, read, catalog, config. Everything is delegated:

# SQL
df = raiju.sql("SELECT 1 AS one")

# DataFrame API
df = raiju.range(10).filter("id > 5")

# Read data
df = raiju.read.csv("path/to/file.csv", header=True)

# Catalog, UDFs, config
raiju.catalog.listTables()
raiju.conf.set("key", "value")

Any attribute or method on SparkSession is available on your Raiju instance; returned objects (DataFrames, etc.) are standard PySpark types.

How It Works

  • No hardcoded API: Raiju and its builder use __getattr__ to forward to the real SparkSession (and SparkSession.builder). New PySpark methods and options work without changes to Raiju.
  • Single entry point: You get a Raiju instance; .read, .sql, .range, and everything else behave as in PySpark.
  • Thin wrapper: This layer is the base; you can add behavior on top without reimplementing Spark.

Development

pip install -e ".[dev]"
ruff check raiju/ tests/
ruff format raiju/ tests/
pytest tests/ -v

Changelog

See CHANGELOG.md for release history.

Support

Having trouble? Open an issue on GitHub.

Code of Conduct

This project adheres to the Contributor Covenant Code of Conduct. By participating, you are expected to uphold this code.

Contributing

Contributions are welcome. See CONTRIBUTING.md for how to get started.

Show Your Support

If you're using Raiju, consider adding the Raiju badge to your project's README.md:

[![Raiju](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/seanpavlak/raiju/main/assets/badge.json)](https://github.com/seanpavlak/raiju)

License

This repository is licensed under the MIT License.

Security

To report a security concern or vulnerability, see SECURITY.md.

Project details


Download files

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

Source Distribution

raiju-0.1.1.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

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

raiju-0.1.1-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file raiju-0.1.1.tar.gz.

File metadata

  • Download URL: raiju-0.1.1.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for raiju-0.1.1.tar.gz
Algorithm Hash digest
SHA256 67a55a5c81e3fc684d289bc031067ff2c76e1c633100f41d20c4306f7c20dab7
MD5 0ed7eb082377a2ac1cb1aff7c30644ff
BLAKE2b-256 521ee807de8b61142c6c62f5615a9f88dd7944b97a562c64bfbfdf06b27521cb

See more details on using hashes here.

Provenance

The following attestation bundles were made for raiju-0.1.1.tar.gz:

Publisher: pypi-publish.yml on seanpavlak/raiju

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file raiju-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: raiju-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for raiju-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3e4ce122cae15e16d5857d954a88c54cdc02031fcb68b7986cdae646ba2c7fdc
MD5 b7897b600d6564e46282132829e992c8
BLAKE2b-256 c3d2ca5054bf40de8628be354696c428cef8f767e4963c7993962d49a62d8e08

See more details on using hashes here.

Provenance

The following attestation bundles were made for raiju-0.1.1-py3-none-any.whl:

Publisher: pypi-publish.yml on seanpavlak/raiju

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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