Spade SDK provides basic classes to implement Spade Files and Processes. For more information about Spade, please visit Spade
It has no dependencies on other Python libraries, and allows development for Spade without a need to install the full Spade app.
pip install spadesdk
For file validation functionality, install with the pandera
extra:
pip install spadesdk[pandera]
FileProcessor
processes the file uploaded by the user in the Spade app.
The FileProcessor
class includes a static validate
method that can validate file
data against a schema using the Pandera library. This method validates DataFrame data
against a Frictionless schema defined in the File
object.
Requirements:
- The
spadesdk[pandera]
package must be installed (available as an optional dependency) - A valid Frictionless schema must be defined in Spade
# Validate DataFrame against the schema
FileProcessor.validate(file, dataframe)
Note: If Pandera is not installed, calling the validate
method will raise an ImportError
.
Executor
executes a Spade process, either by directly running Python code or by
calling an external service.
HistoryProvider
provides the history of a Spade from if the actual process is executed
by an external service. If the process is executed in Spade, a HistoryProvider
is not
needed.