Install & Compatibility
Where this runs
tested against v2.1.17 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 44.6MB
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 3.3s · import 0.000s · 53MB
47MB installed
● package 47MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
ConfigStore
✓ from prophecy.config import ConfigStore
✗ from prophecy.config import ConfigStore
This quickstart demonstrates the essential setup of a SparkSession and how to register Prophecy's User-Defined Functions (UDFs). It highlights the core interaction pattern, though typical usage is within code generated and orchestrated by the Prophecy platform.
import os
from pyspark.sql import SparkSession
from prophecy.udf import UDFs
# This quickstart demonstrates how to initialize a SparkSession
# and register Prophecy's User-Defined Functions (UDFs).
# In a real Prophecy pipeline, this setup is usually handled automatically
# by the generated pipeline entry point.
# Ensure PySpark is installed and available in your environment.
# E.g., `pip install pyspark==3.3.0` (or appropriate version based on prophecy-libs requirements)
def run_quickstart():
# Attempt to use a temporary directory for Spark warehouse for local testing
warehouse_dir = os.path.join(os.getcwd(), "spark-warehouse")
if not os.path.exists(warehouse_dir):
os.makedirs(warehouse_dir)
spark = SparkSession.builder \
.appName("ProphecyLibQuickstart") \
.config("spark.sql.warehouse.dir", warehouse_dir) \
.master("local[*]") \
.getOrCreate()
try:
print("SparkSession initialized.")
# Register Prophecy UDFs
UDFs.register_all_udfs(spark)
print("Prophecy UDFs registered successfully.")
# Example: Using a simple UDF (assuming 'concat' or similar exists after registration)
# Note: Actual UDFs depend on the Prophecy project's definitions.
# This is a placeholder to show usage.
df = spark.createDataFrame([("hello", "world")], ["col1", "col2"])
try:
df.createOrReplaceTempView("my_table")
result = spark.sql("SELECT concat(col1, ' ', col2) as greeting FROM my_table")
print("\nExample UDF usage (if 'concat' is available via UDFs):")
result.show()
except Exception as e:
print(f"Could not demonstrate UDF usage (e.g., concat): {e}")
except Exception as e:
print(f"An error occurred during quickstart: {e}")
finally:
spark.stop()
print("SparkSession stopped.")
if __name__ == "__main__":
run_quickstart()
Upgrade
Version history
2.1.17latest on PyPI · released Apr 14, 2026
Audit
Dependencies
pysparkrequiredCore dependency for Spark-based data pipelines. Requires a specific version range (e.g., >=3.3.0,<4.0.0).
pandasrequiredUsed for data manipulation within some pipeline components.
delta-sparkrequiredRequired for interacting with Delta Lake tables.
python-dotenvoptionalFor managing environment variables, often for local development.
databricks-sdkoptionalFor interacting with Databricks platform resources.