Skip to main content

Spark DataFrame helpers on raikou-core: sessions, frames, and expression helpers.

Project description

raikou

High-level Spark helpers built on raikou-core.

PyPI: https://pypi.org/project/raikou/

Repository: https://github.com/eddiethedean/raikou

raikou provides:

  • SparkSession helpers (connect)
  • a small DataFrame-style facade (RaikouDataFrame) backed by raikou-core's engine
  • convenience expression helpers (col, lit)

Requirements

  • Python: 3.10+
  • Spark: pyspark>=3.4,<4 (a Spark runtime must be available in your environment)

Install

pip install raikou

Quick start

from raikou import RaikouDataFrame, Schema, col, connect


class Row(Schema):
    x: int
    y: str


spark = connect(master="local[2]")
sdf = spark.createDataFrame([{"x": 1, "y": "a"}, {"x": 2, "y": "b"}])

df = RaikouDataFrame[Row].from_spark_dataframe(sdf)
out = df.filter(col("x") > 1).select("y").to_dict()

What’s in the box?

  • connect(...): convenience helper for creating/configuring a SparkSession
  • Schema: typed row schema for a RaikouDataFrame
  • RaikouDataFrame[T]: a small, typed facade backed by the raikou-core engine
  • col(...) / lit(...): expression helpers used with filter, select, etc.

Development (monorepo)

From the repository root:

make install-editable
make test
make lint
make format

Relationship to raikou-core

raikou depends on raikou-core for the Spark-backed execution engine and planning/expression layer. If you only need the engine primitives (e.g. for building another library), you can depend on raikou-core directly.

License

MIT (see repository LICENSE).

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

raikou-0.1.0.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.

raikou-0.1.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file raikou-0.1.0.tar.gz.

File metadata

  • Download URL: raikou-0.1.0.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for raikou-0.1.0.tar.gz
Algorithm Hash digest
SHA256 632ac1564f7a128fcfaf5c0a6438e54bd5576231be6a07d93b313ab795b16d92
MD5 cec25063a654de0b346e67b570301d9e
BLAKE2b-256 8ce86a48af35ae080b62153f460af8825c8b909f535f8095fd3a404cc973f3a0

See more details on using hashes here.

File details

Details for the file raikou-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: raikou-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for raikou-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bf77366ca591f181fee2160774fd589c4c0965c87db189963931df1b1a753eef
MD5 d84a125b37d2f30980237968d9feba8c
BLAKE2b-256 29e889a8812e86bea875b2e4f0b43bad3f5a4ecce3fb3de3a75e857e3e5200e7

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