Registry / data / prophecy-libs

prophecy-libs

JSON →
library2.1.17pypypiunverified

Prophecy Python Libraries (`prophecy-libs`) provides helper functions and utilities for Python code generated by the Prophecy data engineering platform. It facilitates the execution, configuration, and integration of Prophecy-generated data pipelines with Apache Spark. The library is actively maintained with frequent releases, typically accompanying platform updates.

pip install prophecy-libs
INSTALL
IMPORT
SIG · PROPHECY-LIBS
P
prophecy-libs
datapythonv2.1.17
Install
3.3s avg
Import
—
Disk
47MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
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
musl
py 3.10–3.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 44.6MB
glibc
py 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()
Debug
Known issues
gotchaProphecy-libs is primarily a helper library for code generated by the Prophecy data engineering platform. While usable standalone, its full context and intended behavior are realized within a Prophecy-generated project, where configurations and Spark sessions are often managed automatically by the platform.
fix
Understand that direct manual use might require more setup (e.g., SparkSession, ConfigStore initialization) than expected in a generated pipeline environment.
affects: All versions
breakingStrict dependency on PySpark versions. Prophecy pipelines are built on Spark, and the library has specific PySpark version compatibility requirements (e.g., `pyspark>=3.3.0,<4.0.0` for v2.x.x). Using an incompatible PySpark version will lead to runtime errors.
fix
Always install a `pyspark` version that precisely matches the requirements specified in `prophecy-libs`'s PyPI metadata (e1.g., `pip install prophecy-libs 'pyspark>=3.3.0,<4.0.0'`).
affects: All versions
gotchaConfiguration values (via `ConfigStore`) are typically injected at runtime by the Prophecy platform, especially when deploying to environments like Databricks. Manually setting configurations using `ConfigStore.init()` in local tests might be overwritten or behave differently in deployed pipelines.
fix
For local testing, consider mocking or carefully initializing `ConfigStore` to simulate the runtime environment. In production, rely on the Prophecy platform's configuration injection mechanisms.
affects: All versions
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.
Agent activity
37 hits · last 30 days
node
32
OpenAI (training)
1
Resources
prophecy-libs — pip install prophecy-libs · libregistry