Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

omle-spark

Score OMLE models on Spark DataFrames.

OMLEModel is a Spark ML Transformer that delegates to the JVM-side io.github.openmle.spark.OMLEModel, so scoring runs natively on each executor rather than through a Python UDF.

from omle_spark import OMLEModel

model = OMLEModel(modelPath="/path/to/model.omle")
predictions = model.transform(df)

Input columns are resolved from the model's own input specs. A model with a single rank-2 input reads from featuresCol, following the usual Spark ML convention for a pre-assembled vector:

from pyspark.ml.feature import VectorAssembler

assembler = VectorAssembler(inputCols=["f0", "f1"], outputCol="features")
predictions = model.transform(assembler.transform(df))

A model with multiple or scalar inputs reads each one by name straight from the DataFrame, so no VectorAssembler is needed.

Output depends on the model's output count: a single output produces predictionCol (DoubleType); multiple outputs produce probabilityCol (VectorType) plus predictionCol holding the argmax.

Setting up the session

The JARs ship inside this package, so there is nothing to build and no native library to install on the nodes. They do have to be on the class-path before the JVM starts, so name them when the session is created:

import omle_spark
from pyspark.sql import SparkSession

spark = (SparkSession.builder
         .config("spark.jars", omle_spark.jars_classpath())
         .getOrCreate())

spark.jars also ships them to the executors, and JNA extracts the right libomleruntime for each node's platform out of the bundled omle-runtime JAR — covering linux, macOS and Windows on x86-64 plus linux and macOS on arm64 — so jna.library.path is not needed anywhere.

Configuring this after getOrCreate() has no effect: a JVM already running cannot be given new JARs, and transform then fails with 'JavaPackage' object is not callable, which names no cause.

Spark 3.5 (Scala 2.12) and Spark 4.x (Scala 2.13) are both supported. The two are binary-incompatible, so the package carries a build for each and jars_classpath() picks the one matching the installed PySpark — read from PySpark's own spark-core JAR name, not guessed from its version.

omle_spark.jars() returns the same paths as a list, for anything that wants them individually.

License

Apache-2.0

Release files for omle-spark 0.1.0rc7

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

Source distribution (sdist)

Source distribution for omle-spark 0.1.0rc7
File Size Uploaded
omle_spark-0.1.0rc7.tar.gz 10.5 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for omle-spark 0.1.0rc7
File Interpreter ABI Platform
omle_spark-0.1.0rc7-py3-none-any.whl Python 3 none any Details

Total release size: 20.9 MB

Release files / omle_spark-0.1.0rc7.tar.gz

Download URL omle_spark-0.1.0rc7.tar.gz
Size 10.5 MB
Tags Source
SHA-256 checksum
How to use checksums
5be5290ed5d4a05628a8b74a32abd149f3bf2e503c21aa763901c6102163e7bc
BLAKE2b-256 checksum
How to use checksums
6d0527e748b4aa17e31b3bf3ad1bcd0e15a8f806829c06071d15634d5d06123e
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 Sep 20, 2026.

Transparency log

Release files / omle_spark-0.1.0rc7-py3-none-any.whl

Download URL omle_spark-0.1.0rc7-py3-none-any.whl
Size 10.4 MB
Tags Python 3
SHA-256 checksum
How to use checksums
40061070abcb0f449ca03c234324f4b89839d687dcd11755968e0fa77a8d87da
BLAKE2b-256 checksum
How to use checksums
75ab8540769c1337f9fbdb2ae86770523aa0e5925c5ab28006b1c99755af9ff9
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 Sep 20, 2026.

Transparency log
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