Skip to main content

Spade SDK

Project description

Spade SDK

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.

Installation

pip install spadesdk

Optional Dependencies

For file validation functionality, install with the pandera extra:

pip install spadesdk[pandera]

Usage

All core classes are available directly from the top-level package:

from spadesdk import Executor, Process, RunResult, File, FileProcessor, FileUpload, HistoryProvider, User

Basic objects

FileProcessor

FileProcessor processes the file uploaded by the user in the Spade app.

File Validation

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. If file.schema is None, a ValueError is raised.

Executor

Executor executes a Spade process, either by directly running Python code or by calling an external service.

HistoryProvider

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.

Note: The get_runs() method receives a request parameter that is expected to be a Django HTTP request object. HistoryProvider implementations are therefore coupled to Django.

Releasing

Releases are published to PyPI automatically via GitHub Actions when a version tag is pushed:

git tag 0.5.0
git push origin 0.5.0

The workflow builds a wheel and sdist with uv build, then publishes using OIDC trusted publishing (no API token needed). Requires a pypi environment configured in the GitHub repository settings.

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

spadesdk-0.5.0.tar.gz (43.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spadesdk-0.5.0-py3-none-any.whl (29.7 kB view details)

Uploaded Python 3

File details

Details for the file spadesdk-0.5.0.tar.gz.

File metadata

  • Download URL: spadesdk-0.5.0.tar.gz
  • Upload date:
  • Size: 43.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for spadesdk-0.5.0.tar.gz
Algorithm Hash digest
SHA256 74077dc702c3a6f019ece753b76f3d81edad5923ca86dcce5ef9169dbef469e6
MD5 0e13f146a849b167b15bee9a9119a4aa
BLAKE2b-256 cc7031b63f4a02846ac3c6dc10d3cf5e0312c86b834857c970472ad6d55eb2d2

See more details on using hashes here.

Provenance

The following attestation bundles were made for spadesdk-0.5.0.tar.gz:

Publisher: release.yml on crugroup/spadesdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spadesdk-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: spadesdk-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 29.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for spadesdk-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 621e69f2ed0281ddeaa82dc5e0f677bb9ac7cb87dae1c83d31f0a0a742a0d3af
MD5 795a8ef04adc847dc7b58014004e5208
BLAKE2b-256 c5aca4943e037fb15ea7eb318a7dc1d14b3ea5360c204c99f443114249938058

See more details on using hashes here.

Provenance

The following attestation bundles were made for spadesdk-0.5.0-py3-none-any.whl:

Publisher: release.yml on crugroup/spadesdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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